Created
March 31, 2023 17:36
-
-
Save curiousercreative/b96c977009e36bad7edf6d25b2e3804f to your computer and use it in GitHub Desktop.
Script to configure displays using xrandr from an enumerated list
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
#! /usr/bin/env bash | |
# displays.sh single | |
# displays.sh stack | |
# displays.sh split | |
# displays.sh triple | |
case $1 in | |
single) | |
xrandr \ | |
--output DP-4 --auto --primary \ | |
--output HDMI-0 --off \ | |
--output DP-2 --off | |
;; | |
stack | dual | dual-stack) | |
xrandr \ | |
--output DP-4 --auto --pos 0x2160 --primary \ | |
--output HDMI-0 --auto --pos 720x0 \ | |
--output DP-2 --off | |
;; | |
split | dual-split) | |
xrandr \ | |
--output DP-4 --auto --pos 0x0 --primary \ | |
--output HDMI-0 --off \ | |
--output DP-2 --auto --pos 2560x0 | |
;; | |
triple) | |
xrandr \ | |
--output DP-4 --auto --pos 0x2160 --primary \ | |
--output HDMI-0 --auto --pos 720x0 \ | |
--output DP-2 --auto --pos 2560x2160 | |
;; | |
*) | |
echo 'please specify a configuration, one of: single, stack, split, triple' | |
exit 1 | |
esac | |
exit 0 |
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
#! /usr/bin/env bash | |
vi ~/.local/bin/displays.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment