diff options
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/awesome-xrandr | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/.local/bin/awesome-xrandr b/.local/bin/awesome-xrandr index 5a7f880..c816883 100755 --- a/.local/bin/awesome-xrandr +++ b/.local/bin/awesome-xrandr @@ -1,37 +1,11 @@ #!/bin/sh -# get the hostname -hostname=$(hostname) +DEFAULT_SCREEN="HDMI-0" +for SCREEN in $(xrandr | grep "connected" | awk '{ print$1 }' | grep -v "$DEFAULT_SCREEN"); do + xrandr --output "$SCREEN" --off +done +xrandr --output "$DEFAULT_SCREEN" --primary --auto --pos 0x0 --rotate normal +xrandr --output "$DEFAULT_SCREEN" --panning 0x0 -# check the hostname and restore default screen config based on machine being used -case $hostname in - localhost-431) - DEFAULT_SCREEN="eDP1" - for SCREEN in $(xrandr | grep "connected" | awk '{ print$1 }' | grep -v "$DEFAULT_SCREEN"); do - xrandr --output "$SCREEN" --off - done - xrandr --output "$DEFAULT_SCREEN" --primary --auto --pos 0x0 --rotate normal - xrandr --output "$DEFAULT_SCREEN" --panning 0x0 - ;; - librehost431) - DEFAULT_SCREEN="LVDS1" - for SCREEN in $(xrandr | grep "connected" | awk '{ print$1 }' | grep -v "$DEFAULT_SCREEN"); do - xrandr --output "$SCREEN" --off - done - xrandr --output "$DEFAULT_SCREEN" --primary --auto --pos 0x0 --rotate normal - xrandr --output "$DEFAULT_SCREEN" --panning 0x0 - ;; - micomp-linux) - DEFAULT_SCREEN="HDMI1" - for SCREEN in $(xrandr | grep "connected" | awk '{ print$1 }' | grep -v "$DEFAULT_SCREEN"); do - xrandr --output "$SCREEN" --off - done - xrandr --output "$DEFAULT_SCREEN" --primary --auto --pos 0x0 --rotate normal - xrandr --output "$DEFAULT_SCREEN" --panning 0x0 - ;; - *) - echo "unknown machine, attempting autorandr..." - notify-send "awesome-xrandr" "unknown machine, attempting autorandr..." -t 10000 - autorandr || notify-send "awesome-xrandr" "autorandr command not found" -t 10000 - ;; -esac +# if above does not work run the following command manually: +# xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output DP1-1 --off --output DP1-2 --off --output DP1-3 --off --output DP2 --off --output DP2-1 --off --output DP2-2 --off --output DP2-3 --off --output HDMI1 --off --output HDMI2 --off --output VIRTUAL1 --off |
