scripts/toggle-xrandr
2024-12-25 21:14:35 +01:00

22 lines
291 B
Bash
Executable File

#!/bin/sh
doIt() {
if xrandr | grep 'HDMI-A-0' | grep disconnected >/dev/null; then
xrandr --output eDP --set TearFree "$1"
else
xrandr --output HDMI-A-0 --set TearFree "$1"
fi
}
case "$1" in
"on")
doIt "on"
;;
"off")
doIt "off"
;;
*)
echo "That option doesn't exist"
;;
esac