A quick search tells me there is something called Screenruler in linux, does that work for your usecase?
Haven't used it myself so I can't give any endorsement or critiques, but it seems to be similar to the linked windows tool
A community for everything relating to the GNU/Linux operating system
Also check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
A quick search tells me there is something called Screenruler in linux, does that work for your usecase?
Haven't used it myself so I can't give any endorsement or critiques, but it seems to be similar to the linked windows tool