A simple tool is the import command from ImageMagick. Simply provide an output filename:
$ import /tmp/out.png
and it will grab the mouse and show an appropriate cursor. Press button 1 and drag out a rectangle which will be shown as a wire frame. Let go and the file will be created. You can get the info from this file:
$ identify /tmp/out.png
/tmp/out.png PNG 1515x14 1920x1080+24+15 ...
The rectangle in this example was 1515 by 14 pixels, with top-left offset of 24 and 15 on the screen.
To extract a geometry string:
$ identify /tmp/out.png | perl -ne '/ (\d+x\d+) \d+x\d+([-+]\d+[-+]\d+) / and print "$1$2\n"'
1515x14+24+15
Everything in one line:
import PNG:- | identify PNG:- | perl -ne '/ (\d+x\d+) \d+x\d+([-+]\d+[-+]\d+) / and print "$1$2\n"