Created
July 27, 2020 07:27
-
-
Save Zrubi/78eeb7d735956a5fa9401558ff1f313d to your computer and use it in GitHub Desktop.
This tool is used to help switching pre-defined display settings
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 | |
if [[ -z "$1" ]] || [[ "$1" == "--help" ]] | |
then | |
echo "" | |
echo "This tool is used to help switching pre-defined display settings" | |
echo "" | |
echo -e "Usage:\t$0 <Name>" | |
echo "" | |
exit | |
elif [[ $1 = "Internal" ]] | |
then | |
echo "Setting displays to '$1'" | |
xrandr --output eDP1 --pos 0x0 --output DP1 --off --output DP2 --off --output HDMI1 --off --output HDMI2 --off | |
qvm-start-gui --notify-monitor-layout --all | |
exit | |
elif [[ $1 = "Home" ]] | |
then | |
echo "Setting displays to '$1'" | |
xrandr --output eDP1 --pos 320x1080 --primary --output HDMI2 --pos 0x0 --auto | |
qvm-start-gui --notify-monitor-layout --all | |
exit | |
elif [[ $1 = "Office" ]] | |
then | |
echo "Setting displays to '$1'" | |
xrandr --output eDP1 --pos 320x1440 --primary --output HDMI2 --pos 0x0 --auto | |
qvm-start-gui --notify-monitor-layout --all | |
exit | |
else | |
echo "ERROR: Display Setting '$1' is not defined." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment