From 5ec674fda757404cadc8f4c843c7ce7e832ab3d6 Mon Sep 17 00:00:00 2001 From: Blista Kanjo Date: Fri, 14 Jul 2023 06:23:13 -0400 Subject: refactor: revert to basic `awesome-xrandr` script --- .local/bin/awesome-xrandr | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to '.local/bin/awesome-xrandr') 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 -- cgit v1.2.3