Hello! I am a web developer, and with the layout of an HTML template, I constantly have to check pixel distances, ratios, angles, etc., unnecessary trivia. Of course, there are all sorts of dev-tools, screen loops, screenshots with a graphic editor, and finally, God forgive me. But this is all wrong. And then an idea occurred to me. What do we need composite managers and a mouse for? Why not measure right over the browser page? The only hitch was that, apart from Perl, JavaScript, and other php and bashi, I really don’t know any languages. But I am stubborn. As a result, I did write something.

It turned out a very funny little animal, about which I am writing here, amusing myself with the hope that someone can come in handy. Although ... For the reason stated above, it turned out a kind of animal: Linux, GTK + 2, Perl (with modules GTK2-Perl, Perl YAML, Perl Math :: Round).
')
So the idea was this. Run the script (I hung it on the hotkey for convenience), the GTK-shnoe window opens in fullscreen with a transparent background. Everything. Next, using Cairo, Perl and someone's grandmother, the cursor lines are displayed on top of the current live drawing of the screen (horizontal and vertical - crosshairs in full screen). Using the mouse and keyboard, you can select different areas of the screen. This draws a selection rectangle, diagonal, numeric values (width, height, starting and ending coordinates, angle), auxiliary guides (center points, golden section, etc.; all this is turned on / off and configured in the config file). Requires enabled composite output mode.

In the process of selection, it is possible to take screenshots of the selection on the clipboard and / or file on disk, save the current numerical values of the selection to the clipboard, switch to the selection mode from the center, limit the selection to any of the specified aspect ratios (you can customize them and add new in the config), change the colors of different lines according to the list of color schemes (configured in the same config; in general, almost everything is configured there, so I’ll try not to make a reservation later), etc.
Current selections can be saved. That is, pressed the button, the selection remains on the screen - you can make a new one. In addition, you can put the guides - as long as only horizontal and vertical (with the possibility of sticking to them during the selection, of course). Guides, ash stump, also saved.

In general, there are three main layers: the current selection, the saved selections, and the saved guides. You can switch between layers of saved selections and guides, select any saved selection or guide, drag, delete ... Ostap suffered, and he began to describe almost a vector editor, only without figures and on the transparent background of the application. Actually, this is the essence of the script + useful tsiferki measurements before my eyes.
For the convenience of screenshots, I implemented a “disguise” of the selections (current or selected saved), when everything except for the selection is shaded. The transparency of the shading is controlled by the same mouse with the alto clamped.

In general, there are already quite a lot of functionalities, and now I find myself thinking that it is haphazard, messy and without details, I am beginning to rewrite the already written manual. The script is open source, GPL v3, so this is not an advertisement, and I write about it here with two goals: to share with the world, and to get constructive criticism whenever possible with a view to improving it.
You can read more in the manual on my site.
In general, the script is part of the intended utility package, which has already accumulated decently, but for this post I started a separate
github repository.
I would be glad to comment, suggestions and criticism.