Skip to content

Instantly share code, notes, and snippets.

@pyropeter
Created February 16, 2017 22:26
Show Gist options
  • Save pyropeter/1af21a1434d83428e86550cb8466e3de to your computer and use it in GitHub Desktop.
Save pyropeter/1af21a1434d83428e86550cb8466e3de to your computer and use it in GitHub Desktop.
i3 screen setup stuff
bindsym XF86Display exec --no-startup-id ~/.i3/setup-screens
#!/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