-
-
Save wellic/b68f90055e47735dd5999d7327701637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IN=LVDS-0; | |
setoff() { | |
for display in `xrandr | awk '/ disconnected/ {print $1}'`; do | |
echo "maybe disabling $display"; | |
xrandr --output $display --off; | |
done; | |
} | |
seton() { | |
CMD="xrandr --output $IN --auto --primary"; | |
for display in `xrandr | awk '/ connected/ {print $1}'`; do | |
if [ "$display" != "$IN" ]; then | |
CMD="$CMD --output $display --auto --right-of $IN"; | |
fi | |
done; | |
echo $CMD; | |
$CMD; | |
} | |
setoff; | |
seton; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment