Added toggle-gdctl-scale
This commit is contained in:
19
toggle-gdctl-scale
Executable file
19
toggle-gdctl-scale
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if gnome-shell is running as `gdctl` is GNOME only
|
||||
if ! pgrep -x "gnome-shell" > /dev/null; then
|
||||
echo "Error: gnome-shell is not running."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Set scale explicitly to argument value.
|
||||
if [ $# -eq 1 ]; then
|
||||
gdctl set -LM Meta-0 --primary --scale $1
|
||||
else
|
||||
# If no argument is given, toggle between 1.0 and 1.5 scales.
|
||||
if gdctl show | grep -q "Scale: 1.0"; then
|
||||
gdctl set -LM Meta-0 --primary --scale 1.5
|
||||
else
|
||||
gdctl set -LM Meta-0 --primary --scale 1
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user