Created
November 29, 2012 20:23
-
-
Save mdellabitta/4171654 to your computer and use it in GitHub Desktop.
Simple script for autodetecting number of displays and switching between xrandr/arandr 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
#!/usr/bin/env ruby | |
output = `xrandr --query` | |
ids = output.lines.find_all do |line| | |
line =~ /\sconnected/ | |
end | |
if ids.size == 1 | |
`~/.screenlayout/Mobile.sh` | |
else | |
`~/.screenlayout/Desktop.sh` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment