Created
July 23, 2015 01:34
-
-
Save dinoocch/3b853ed9132d818fb0dc to your computer and use it in GitHub Desktop.
Shell Script to set resolution and arrange monitors.
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/bash | |
connectedOutputs=$(xrandr | grep " connected" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/") | |
execute="xrandr " | |
previous="" | |
for display in $connectedOutputs | |
do | |
# Turn on and set resolution of the monitorsr | |
execute=$execute"--output $display --auto " | |
if [ "$previous" != "" ] | |
then | |
execute=$execute"--right-of "$previous | |
fi | |
previous="$display" | |
done | |
echo "Command: $execute" | |
`$execute` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment