From 6a9d286e5565b4bbb63f1813a92613b821c7d2a3 Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 19 May 2026 18:26:28 +0200 Subject: [PATCH] fixed workspace navigation --- desktopenvs/hyprlua/eww-touch/eww.yuck | 4 ++-- desktopenvs/hyprlua/scripts/unified-rotate.sh | 12 ++++++++++-- .../hyprlua/scripts/workspacefocus/focusleft.sh | 3 +++ .../hyprlua/scripts/workspacefocus/focusright.sh | 3 +++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 desktopenvs/hyprlua/scripts/workspacefocus/focusleft.sh create mode 100755 desktopenvs/hyprlua/scripts/workspacefocus/focusright.sh diff --git a/desktopenvs/hyprlua/eww-touch/eww.yuck b/desktopenvs/hyprlua/eww-touch/eww.yuck index 098a851..3a8186f 100644 --- a/desktopenvs/hyprlua/eww-touch/eww.yuck +++ b/desktopenvs/hyprlua/eww-touch/eww.yuck @@ -48,7 +48,7 @@ :orientation "h" :space-evenly false :halign "center" - :onclick "hyprctl eval 'hl.dsp.focus({workspace=\"r-1\"})'" + :onclick "~/.config/scripts/workspacefocus/focusleft.sh" {""} ) @@ -78,7 +78,7 @@ :orientation "h" :space-evenly false :halign "center" - :onclick "hyprctl eval 'hl.dsp.focus({workspace=\"r+1\"})'" + :onclick "~/.config/scripts/workspacefocus/focusright.sh" {""} ) diff --git a/desktopenvs/hyprlua/scripts/unified-rotate.sh b/desktopenvs/hyprlua/scripts/unified-rotate.sh index eefc17b..7c44b11 100755 --- a/desktopenvs/hyprlua/scripts/unified-rotate.sh +++ b/desktopenvs/hyprlua/scripts/unified-rotate.sh @@ -13,6 +13,14 @@ monitors_json=$(hyprctl monitors -j) curmon=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .name') currot=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .transform') +curscale=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .scale') +curwidth=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .width') +curheight=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .height') +currefresh=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .refreshRate | round') +curx=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .x') +cury=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .y') + +curmode="${curwidth}x${curheight}@${currefresh}" # Calculate new rotation if [[ "$direction" == "cw" ]]; then @@ -33,8 +41,8 @@ fi echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)" -# Apply new rotation to monitor (hyprctl keyword doesn't work with Lua config) -hyprctl eval "hl.monitor({output='$curmon', transform=$newrot})" +# Apply new rotation while preserving current mode and scale +hyprctl eval "hl.monitor({output='$curmon', mode='$curmode', position='${curx}x${cury}', scale=$curscale, transform=$newrot})" # Detect touchscreen device name touchdev=$(hyprctl devices -j | jq -r '.touch[0].name // empty') diff --git a/desktopenvs/hyprlua/scripts/workspacefocus/focusleft.sh b/desktopenvs/hyprlua/scripts/workspacefocus/focusleft.sh new file mode 100755 index 0000000..0723e17 --- /dev/null +++ b/desktopenvs/hyprlua/scripts/workspacefocus/focusleft.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +hyprctl dispatch 'hl.dsp.focus({ workspace = "r-1" })' diff --git a/desktopenvs/hyprlua/scripts/workspacefocus/focusright.sh b/desktopenvs/hyprlua/scripts/workspacefocus/focusright.sh new file mode 100755 index 0000000..ce45628 --- /dev/null +++ b/desktopenvs/hyprlua/scripts/workspacefocus/focusright.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +hyprctl dispatch 'hl.dsp.focus({ workspace = "r+1" })'