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 linux operating system
Also check out !linux_memes@programming.dev
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
I use kruler in KDE.