Skip to content

Instantly share code, notes, and snippets.

@Zrubi
Created July 27, 2020 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zrubi/78eeb7d735956a5fa9401558ff1f313d to your computer and use it in GitHub Desktop.
Save Zrubi/78eeb7d735956a5fa9401558ff1f313d to your computer and use it in GitHub Desktop.
This tool is used to help switching pre-defined display settings
#!/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