Created
January 5, 2015 20:39
-
-
Save skeggse/f417a01873f328325d21 to your computer and use it in GitHub Desktop.
Simplified xrandr script for horizontal monitor layouts
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 | |
# arrange outputs in order of name | |
params=() | |
prev='' | |
verbose=0 | |
if [ "$1" == '-v' ] || [ "$1" == '--verbose' ]; then | |
verbose=1 | |
shift | |
fi | |
if [ "$#" -lt 1 ]; then | |
echo "usage: quick-display [-v] <output1> [<output2> <output3>...]" >&2 | |
exit 1 | |
fi | |
for output in $@; do | |
if [ "$output" == 'internal' ] || [ "$output" == 'laptop' ]; then | |
output='eDP1' | |
fi | |
params+=('--output' "$output" '--auto') | |
if [ "$prev" != '' ]; then | |
params+=('--right-of' "$prev") | |
fi | |
prev="$output" | |
done | |
if [ $verbose -eq 1 ]; then | |
echo xrandr "${params[@]}" | |
fi | |
xrandr "${params[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment