From 588684b25b9757c6cadc858ba250fa95227f250a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 27 Jun 2023 00:23:22 +0200 Subject: [PATCH] fix: fix autorotate --- hypr/scripts/autorotate.sh | 49 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/hypr/scripts/autorotate.sh b/hypr/scripts/autorotate.sh index 5c12ed73..66ddde7d 100755 --- a/hypr/scripts/autorotate.sh +++ b/hypr/scripts/autorotate.sh @@ -8,36 +8,41 @@ WAYLANDINPUT=("wacom-hid-52eb-finger" "wacom-hid-52eb-pen") + function rotate_ms { - case $1 in - "normal") - rotate 0 - ;; - "right-up") - rotate 3 - ;; - "bottom-up") - rotate 2 - ;; - "left-up") - rotate 1 - ;; - esac + if [[ $(hyprctl activewindow | grep Waydroid) == "" ]]; then + case $1 in + "normal") + rotate 0 + ;; + "right-up") + rotate 3 + ;; + "bottom-up") + rotate 2 + ;; + "left-up") + rotate 1 + ;; + esac + elif [[ $(hyprctl monitors | grep "transform: 0") == "" ]]; then + rotate 0 + fi } function rotate { - TARGET_ORIENTATION=$1 + TARGET_ORIENTATION=$1 - echo "Rotating to" $TARGET_ORIENTATION + echo "Rotating to" $TARGET_ORIENTATION - hyprctl keyword monitor $SCREEN,transform,$TARGET_ORIENTATION + hyprctl keyword monitor $SCREEN,transform,$TARGET_ORIENTATION - for i in "${WAYLANDINPUT[@]}" - do - hyprctl keyword device:"$i":transform $TARGET_ORIENTATION - done + for i in "${WAYLANDINPUT[@]}" + do + hyprctl keyword device:"$i":transform $TARGET_ORIENTATION + done - /home/matt/.config/lisgd/config & + /home/matt/.config/lisgd/config & } while IFS='$\n' read -r line; do