diff --git a/desktopenvs/hyprland/scripts/unified-rotate.sh b/desktopenvs/hyprland/scripts/unified-rotate.sh index 3ef16aa..ddb2585 100755 --- a/desktopenvs/hyprland/scripts/unified-rotate.sh +++ b/desktopenvs/hyprland/scripts/unified-rotate.sh @@ -10,10 +10,12 @@ if [[ "$direction" != "cw" && "$direction" != "ccw" ]]; then fi # Get current monitor name -curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}') +# curmon=$(hyprctl monitors | awk '/focused: yes/{getline; print $2}') +curmon=$(hyprctl monitors | grep -B12 "focused: yes" | head -n1 | awk '{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}}}') +# currot=$(hyprctl monitors | awk '/focused: yes/{for(i=0;i<15;i++){getline;if($1=="transform:"){print $2;break}}}') +currot=$(hyprctl monitors | grep -B1 "focused: yes" | head -n1 | awk '{print $2}') # Calculate new rotation if [[ "$direction" == "cw" ]]; then @@ -33,7 +35,7 @@ fi echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)" # Apply new rotation to monitor -hyprctl keyword monitor "$curmon,preferred,auto,0x0,$newrot" +hyprctl keyword monitor "$curmon,preferred,auto,1,transform,$newrot" # Detect touchscreen device name touchdev=$(hyprctl devices | awk '/Touchscreen/{getline; print $2}')