Update ctl scripts and formatting

This commit is contained in:
Riyyi
2020-07-10 00:51:46 +02:00
parent 760489123d
commit c435567d34
4 changed files with 83 additions and 67 deletions
+8 -2
View File
@@ -31,9 +31,13 @@ ${B}ARGS${N}
EOF
}
# If no option is provided
# Exit if no option is provided
[ "$#" -eq 0 ] && help && exit 1
# Set required X variables
export DISPLAY=:0
export XAUTHORITY="$XDG_DATA_HOME/xorg/Xauthority"
update() {
sleep 4
@@ -61,7 +65,7 @@ auto() {
xrandr --addmode "$4" "$1x$2_$3.00"
fi
# Get all connected monitor
# Get all connected monitors
CONNECTED="$(xrandr -q | awk '/ connected/{print $1}')"
# Disable all other monitors
@@ -72,11 +76,13 @@ auto() {
update
}
[ $OPTIND -ge 2 ] && shift $((OPTIND - 2))
case "$1" in
a*)
auto "$@"
;;
*)
help
exit 1
;;
esac