My hacky, hacky faux pinch-to-zoom workaround

Dang it! Don’t you wish you could just… pinch… to… zoom… sometimes on the Librem 5?

Especially when on-the-fly compositing renders text so small you can’t read it?

When Ctrl+ and Ctrl- don’t function everywhere?

And when even the apps that do have built-in pinch-to-zoom are often janky?

You could work around the problem by opening the screenshot app, taking the shot, digging through files to find it, opening it in Image Viewer, then zooming around in the image, but wouldn’t it be much more fun to automate some of that… if for no other reason than you can? :crazy_face:

Well, hold my beer!

///

What’s happening in my screen capture below:

1_ I open the Screen capture app, start recording, then minimize it.

2_ I scroll to open Color picker app, then minimize it.

3_ I scroll to my personal ZoomIt “app” and launch it.

4_ ZoomIt automatically opens Terminal, I quickly minimize Terminal, and re-maximize the Color Picker app to wait for the shot, then ZoomIt runs a screenshot command in the background.

5_ After a 4-second delay (adjustable), ZoomIt creates a screenshot, saves it to my designated location, then opens the save-location automatically for me.

6_ I click to open the .png, then demonstrate manual pinch-to-zoom in and out, and drag the image around to view different areas.

7_ I close apps and stop recording.

View gif:

zoomit2

///

How to do it:

A_ Add the following to a text file and save it in home/purism/.local/share/applications as ZoomIt.desktop:

[Desktop Entry]
Name=ZoomIt
Exec=gnome-terminal -x bash -c "sleep 4 && grim /home/purism/YourChosenFolder/screen.png && xdg-open /home/purism/YourChosenFolder/"
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/ZoomIt.png

The commands grim (to grab an image) and sleep (to add a delay) are already installed by default. The resulting screen.png file will be overwritten at every use.

The name of your app can be anything you want.

The xdg-open command will open the location where you sent the screen.png.

B_ Create an icon and save it to /home/purism/.local/share/icons. Make sure the name of your icon matches the name used in the last line of the Desktop application above, including the file extension.

C_ Launcher is added:

///

Fun with phosh!

(No, I didn’t have anything better to do today. And anyway, I learned several new tricks in the process.)
:wink:

8 Likes

Lol it sounds good bu i never have to do it. Cause i have to use it on pictures, and 99 Percentage i have this while use firefox to view that Data/File and just can… you know zoom in like you describe.

However you can have it like you describe Screenshot taking. And in future try to analyze it with your own A.I. or script and expand your information about it buy use some script to extract further information by that snap. If you mind it you can still watch too.

If “i like” to view a snap of my phone more detailed i send it to a screen with higher resolution, nearby. :wink:

2 Likes