diff options
| author | Blista Kanjo | 2023-07-14 06:45:07 -0400 |
|---|---|---|
| committer | Blista Kanjo | 2023-07-14 06:45:07 -0400 |
| commit | 5f5b9234a0ced4ce7b258ce23c32332815d9a146 (patch) | |
| tree | e8eee3ea652252a281a05936e7314461f81e5565 | |
| parent | 660b3627265a177ccce15453d1816bc0e1065635 (diff) | |
feat: utilize `autorandr` if available
| -rwxr-xr-x | .local/bin/awesome-xrandr | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/.local/bin/awesome-xrandr b/.local/bin/awesome-xrandr index c816883..6ce8abf 100755 --- a/.local/bin/awesome-xrandr +++ b/.local/bin/awesome-xrandr @@ -1,11 +1,14 @@ #!/bin/sh DEFAULT_SCREEN="HDMI-0" + +fallback() { + xrandr --output "$DEFAULT_SCREEN" --primary --auto --pos 0x0 --rotate normal + xrandr --output "$DEFAULT_SCREEN" --panning 0x0 +} + 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 -# 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 +autorandr || fallback |
