Ubuntu – Can you do a multi step zoom on Gnome

18.04gesturesgnomeshortcut-keyszooming

I'm on Ubuntu 18.04 with Gnome. I've come over from MacOs and one thing I'm really really missing is it's pinch to zoom feature, expecially in browsers.

I know I can do a Ctrl +/- but that actually zooms in the content itself. With macOs, it zooms the canvas (for lack of a better word) with a pinch. I've tried the magnifier feature with Alt+Super+8 but that just zooms in way too much.

Is there anything out there that I can use to make it similar to the macOs zoom funtionality? The closest I could think of was maybe if the magnifier worked in multiple steps, as in multiple zoom points between minimum and maximum?

Hope that makes sense.

Best Answer

WorkAround

Disable the Default keyboardshortcut Alt+Super+8

Create a Custom keyboardshortcut with command /bin/bash /home/<user>/multizoomup

enter image description here

enter image description here

create a script named multizoomup in /home/<user>/ with below content

#!/bin/bash

key="org.gnome.desktop.a11y.magnifier mag-factor"
current=$(gsettings get $key)
increment=0.2
gsettings set $key $(echo "$current + $increment" | bc -l)
gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled true

Note that the increment I have used is 0.2, you can change this value as you wish.

Now when you press Alt+Super+8, the script reads present value and increase it by 0.2 at every key press

Similarly you can create one more script with below command for decreasing the value by 0.2 with custom shortcut Alt+Super+9

#!/bin/bash

key="org.gnome.desktop.a11y.magnifier mag-factor"
current=$(gsettings get $key)
increment=0.2
gsettings set $key $(echo "$current - $increment" | bc -l)
gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled true

Tested on Ubuntu 18.04.3

enter image description here


Thoughts/ Requests:

Scripting Experts can modify the script to read the current value and increase it by given increment value like 1.0, 1.2, 1.4, 1.6, 1.8 and then back to 1.0 this way we can reduce the additional keyboard shortcut for zoomdown.. This means when we press Alt+Super+8 for the first time it should set the magnifier to 1.2, for the second time 1.4, 3rd 1.6, 4th 1.8 & 5th time back to 1.0

Related Question