From e448d14b7ea15163684f46f379961a70882b822b Mon Sep 17 00:00:00 2001 From: Emily Frost Date: Tue, 29 Jan 2019 12:40:10 -0600 Subject: [PATCH] Added setdisplay script. --- setdisplay | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 setdisplay diff --git a/setdisplay b/setdisplay new file mode 100755 index 0000000..cb99de5 --- /dev/null +++ b/setdisplay @@ -0,0 +1,57 @@ +#!/bin/sh + +if [ "$1" = '-a' ]; then + switch_audio='yes' + video_mode="$2" +else + video_mode="$1" +fi + +case $video_mode in + 'lvds-hdmi2') + xrandr \ + --output HDMI1 --mode 1280x720 --pos 0x0 --rotate normal \ + --output LVDS1 --primary --mode 1366x768 --pos 1368x0 --rotate normal \ + --output VIRTUAL1 --off \ + --output DP3 --off \ + --output DP2 --off \ + --output DP1 --off \ + --output HDMI3 --off \ + --output HDMI2 --off \ + --output VGA1 --off \ + + if [ "$switch_audio" = 'yes' ]; then + ponymix -c 0 set-profile output:hdmi-stereo + fi + ;; + 'hdmi2') + xrandr \ + --output HDMI1 --primary --mode 1280x720 --pos 0x0 --rotate normal \ + --output LVDS1 --off \ + --output VIRTUAL1 --off \ + --output DP3 --off \ + --output DP2 --off \ + --output DP1 --off \ + --output HDMI3 --off \ + --output HDMI2 --off \ + --output VGA1 --off \ + + if [ "$switch_audio" = 'yes' ]; then + ponymix -c 0 set-profile output:hdmi-stereo + fi + ;; + *) + xrandr \ + --output LVDS1 --primary --mode 1366x768 --pos 1368x0 --rotate normal \ + --output HDMI1 --off \ + --output VIRTUAL1 --off \ + --output DP3 --off \ + --output DP2 --off \ + --output DP1 --off \ + --output HDMI3 --off \ + --output HDMI2 --off \ + --output VGA1 --off \ + + ponymix -c 0 set-profile output:analog-stereo + ;; +esac