Created
July 2, 2012 18:50
-
-
Save monokrome/3034871 to your computer and use it in GitHub Desktop.
My Macbook Air video configuration script for ArchLinux / DWM.
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/sh | |
| # Configuration file for my roaming profile. Disables external monitors. | |
| xrandr --output HDMI1 --off |
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/sh | |
| # Enables the monitor configuration at my office. | |
| xrandr --output HDMI1 --auto | |
| xrandr --output HDMI1 --pos 1441x0 |
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 | |
| # Provides a simple wrapper to load configuration files by name. | |
| # | |
| # IE: `update-outputs office` would execute the `office.sh` script | |
| # in ~/.config/monitors/ | |
| requested_configuration="$1" | |
| configurations_directory="${HOME}/.config/monitors/" | |
| configuration_filename="${configurations_directory}${requested_configuration}.sh" | |
| fallback_filename="${configurations_directory}default.sh" | |
| if [[ -f "${configuration_filename}" ]]; then | |
| printf "Executing configuration: ${requested_configuration}\n" | |
| exec "${configuration_filename}" | |
| else | |
| if [[ "${requested_configuration}" != "" ]]; then | |
| printf "Configuration not found for: ${requested_configuration}\nReverting to default.\n" | |
| fi | |
| exec "${fallback_filename}" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment