Last active
March 20, 2021 19:09
-
-
Save askingalot/ac2e9c7b69c15f1353a4b102ee7c3428 to your computer and use it in GitHub Desktop.
Gnome Screen Magnfication Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
magFloor="1.0" | |
magDelta="0.2" | |
magFactor=`gsettings get org.gnome.desktop.a11y.magnifier mag-factor` | |
if [ -z "$1" ]; then | |
magFactor=$magFloor | |
elif [ "$1" == "in" ]; then | |
magFactor=`echo "$magFactor + $magDelta" | bc` | |
elif [ "$1" == "out" ]; then | |
magFactor=`echo "$magFactor - $magDelta" | bc` | |
else | |
echo "Usage: `basename $0` < in | out >" | |
exit 1 | |
fi | |
zoomEnabled="true" | |
if [ `echo $magFactor' <= '$magFloor | bc` == 1 ]; then | |
zoomEnabled="false" | |
magFactor=$magFloor | |
fi | |
`gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled $zoomEnabled` | |
`gsettings set org.gnome.desktop.a11y.magnifier mag-factor $magFactor` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment