Skip to content

Instantly share code, notes, and snippets.

@askingalot
Last active March 20, 2021 19:09
Show Gist options
  • Save askingalot/ac2e9c7b69c15f1353a4b102ee7c3428 to your computer and use it in GitHub Desktop.
Save askingalot/ac2e9c7b69c15f1353a4b102ee7c3428 to your computer and use it in GitHub Desktop.
Gnome Screen Magnfication Script
#!/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