2

For quite a while now, I have been looking to implement my workflow on Linux. Unfortunately, it's accessibility is...spotty, at best. Some stuff works, some stuff works well and some stuff just does not exist. Which surprises me to be honest. But, it is Linux, so it is possible! :)

In GNOME 3, they implemented a screen magnifier (Settings > Universal Access) that allows you to turn on the zoom features, which even includes quite impressive settings for mouse tracking and color inversion (or "lightness" as they call it). But in the keyboard shortcut settings, there is only shortcuts for turning this feature on or off, zooming in or zooming out.

Adding a shortcut to call dconf to flip the bool in org.gnome.desktop.a11y.magnifier.invert-lightness is probably trivial. I just need to look that up.

But more concerning is the zooming in and out using the keyboard and mouse wheel. On Windows and macOS - my current main OSes - you can zoom in by using the mouse wheel or trackpad. This is also possible on iOS and Android by using gestures. But so far, I have not been able to figure out how to create shortcuts for this in GNOME 3.

I contacted Matthias Clasen on Telegram (his contact details were at the bottom of the Gnome 3 Accessibility+Wayland page) and he said that a Gnome extension would be needed to accomplish this. Now, I haven't written one myself yet, nor have I ever looked into those at the first place since I stood away from GUI-based Linux usage for quite a while; I usually use it on dedicated servers which I boss around via SSH.

So what would a possible approach be? I am quite certain that somewhere nearby the org.gnome.desktop.a11y.magnifier.invert-lightness entry is also the one for the current zoom level. So, I imagine that when one presses super while scrolling the mouse wheel forward, you'd only have to increment the current zoom level - and vice versa when scrolling down. I am certain it is possible...but I don't know how.

Hope to have this solved soon so I can hopefuly do more in GUI Linux soon!

(Oh yeah, side info: XFCE4 does have this feature, but it is nowhere near as configurable as GNOME 3's...it just is turned on magically when turning on the accessibility features. I also heared that MATE works with Compiz but I am not aware of other DE's compatibilitys and capabilities.)

2 Answers 2

3

After a bunch of stuffing around, I was able to get magnifier zoom working with the mouse wheel.

The key parts of the solution are xbindkeys for setting up the mouse wheel short cut, and gsettings for getting/setting the magnification factor, and bc for calculating the new magnification factor.

My ~/.xbindkeysrc:

# Adjust magnifier zoom via Alt+mouse scroll. Increases/decreases by a factor
# of 1.2. Sets a min of 1.0.
"gsettings set org.gnome.desktop.a11y.magnifier mag-factor $(echo $(gsettings get org.gnome.desktop.a11y.magnifier mag-factor) \* 1.2 | bc -l)"
    alt+b:4
"gsettings set org.gnome.desktop.a11y.magnifier mag-factor $(echo v=$(gsettings get org.gnome.desktop.a11y.magnifier mag-factor) / 1.2\; if \(v\<1.0\) v=1.0\; v | bc -l)"
    alt+b:5

The trick is reading the current magnification factor with gsettings get org.gnome.desktop.a11y.magnifier mag-factor, using bc multiply/divide by 1.2, then setting again.

There's a bunch of other useful settings as well:

$ gsettings list-keys org.gnome.desktop.a11y.magnifier
scroll-at-edges
contrast-red
cross-hairs-color
mouse-tracking
cross-hairs-clip
contrast-blue
lens-mode
contrast-green
show-cross-hairs
brightness-green
cross-hairs-opacity
invert-lightness
mag-factor
brightness-red
color-saturation
brightness-blue
cross-hairs-length
focus-tracking
caret-tracking
cross-hairs-thickness
screen-position

Specifically I set all the tracking settings (mouse-tracking, focus-tracking and caret-tracking) to push mode, because I found the default settings made the screen jump around too much (especially while using the terminal).

Hope this helps!

1
  • 1
    Thank you! You have no idea how much I appreciate this.
    – FatalError
    Jun 28, 2022 at 18:35
0

I am looking for that as well

Thank you for your work so far. Good to know, that gnome says, an extension is needed.

If you ever should find something that might make it work, please let me know ^^

My best idea myself so far is, to toggle zoom via shortcut. And it seems to be possible, to use xbind to use super(or another modifer) + plus mousewheel to "press" that shortcut.

Here are some websites, that describe, how you implement mousewheel plus modifyer to press shortcuts.

https://gist.github.com/wilmardo/bb3198c7bf429ce8d794b9f44d34b034

http://xahlee.info/linux/linux_xbindkeys_tutorial.html https://www.linux.com/news/start-programs-pro-xbindkeys/ https://medium.com/@Aenon/bind-mouse-buttons-to-keys-or-scripts-under-linux-with-xbindkeys-and-xvkbd-7e6e6fcf4cba

I tried it myself for quite some time, but are getting an error message that says Warning: Cannot convert string "--helvetica-medium-r---12------iso8859-1" to type FontStruct

After looking into that, the only things I could find were in a arch forum, where it was said, that it might get complicated to fix that...

I am running Pop_OS and tried to make "super + mousewheel" press "super+alt+8"

Maybe it might work for you ^^

For now, I am giving up, since I have no idea what I could try next...

Edit: The tool xdotool can send keypresses via terminal. But at least in my case it is really slow in activating..

And xbind now don't accept mousewheel as an trigger... Now I am giving up - and hope for someone who knows how to program for making it possible, that I can zoom in my desktop using the mousewheel 😅️

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .