diff options
| author | Blista Kanjo | 2023-07-14 06:23:13 -0400 |
|---|---|---|
| committer | Blista Kanjo | 2023-07-14 06:23:13 -0400 |
| commit | 5ec674fda757404cadc8f4c843c7ce7e832ab3d6 (patch) | |
| tree | 6345af95aafc04352c9c7f1fd2059b5a0ecb4cd6 /.local/bin/awesome-xrandr | |
| parent | 8f95614e4bf01ddbf6aa6ed5238c786d0d58af72 (diff) | |
refactor: revert to basic `awesome-xrandr` script
Diffstat (limited to '.local/bin/awesome-xrandr')
| -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 |
