Created
February 16, 2017 22:26
-
-
Save pyropeter/1af21a1434d83428e86550cb8466e3de to your computer and use it in GitHub Desktop.
i3 screen setup stuff
This file contains hidden or 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
bindsym XF86Display exec --no-startup-id ~/.i3/setup-screens |
This file contains hidden or 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/bash | |
set -e | |
set -u | |
CORPSES=`xrandr | awk '/^[^ ]* disconnected [^(]/ {print $1}'` | |
CONNECTED=`xrandr | awk '/^[^ ]* connected/ {print $1}'` | |
ARGS=--verbose | |
for output in $CORPSES; do | |
ARGS="$ARGS --output $output --off" | |
done | |
LAST= | |
for output in $CONNECTED; do | |
ARGS="$ARGS --output $output --auto" | |
if [ -n "$LAST" ]; then | |
ARGS="$ARGS --above $LAST" | |
fi | |
LAST="$output" | |
done | |
echo $ARGS | |
xrandr $ARGS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment