diff --git a/toggle-xrandr b/toggle-xrandr new file mode 100755 index 0000000..dc4f7b5 --- /dev/null +++ b/toggle-xrandr @@ -0,0 +1,21 @@ +#!/bin/sh + +doIt() { + if xrandr | grep 'HDMI-A-0' | grep connected >/dev/null; then + xrandr --output HDMI-A-0 --set TearFree "$1" + else + xrandr --output eDP --set TearFree "on" + fi +} + +case "$1" in +"on") + doIt "on" + ;; +"off") + doIt "off" + ;; +*) + echo "That option doesn't exist" + ;; +esac