From af4465a89c989c4da26ac364c7f96503f479d5a7 Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 9 Dec 2025 18:36:13 +0100 Subject: [PATCH] rotation script --- desktopenvs/hyprland/scripts/unified-rotate.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/desktopenvs/hyprland/scripts/unified-rotate.sh b/desktopenvs/hyprland/scripts/unified-rotate.sh index ddb2585..bae1176 100755 --- a/desktopenvs/hyprland/scripts/unified-rotate.sh +++ b/desktopenvs/hyprland/scripts/unified-rotate.sh @@ -4,14 +4,15 @@ # Usage: rotate.sh [cw|ccw] direction="$1" -if [[ "$direction" != "cw" && "$direction" != "ccw" ]]; then - echo "Usage: $0 [cw|ccw]" +if [[ "$direction" != "cw" && "$direction" != "ccw" && "$direction" != "0" && "$direction" != "1" && "$direction" != "2" && "$direction" != "3" ]]; then + echo "Usage: $0 [cw|ccw] OR $0 [0|1|2|3]" + exit 1 fi # Get current monitor name -# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}') curmon=$(hyprctl monitors | grep -B12 "focused: yes" | head -n1 | awk '{print $2}') +# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}') # Get current transform value # currot=$(hyprctl monitors | awk '/focused: yes/{for(i=0;i<15;i++){getline;if($1=="transform:"){print $2;break}}}') @@ -32,6 +33,10 @@ else # ccw fi fi +if [[ "$direction" == "0" || "$direction" == "1" || "$direction" == "2" || "$direction" == "3" ]]; then + newrot="$direction" +fi + echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)" # Apply new rotation to monitor