fixed workspace navigation
parent
a8e9a4b49b
commit
6a9d286e55
|
|
@ -48,7 +48,7 @@
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:halign "center"
|
:halign "center"
|
||||||
:onclick "hyprctl eval 'hl.dsp.focus({workspace=\"r-1\"})'"
|
:onclick "~/.config/scripts/workspacefocus/focusleft.sh"
|
||||||
{""}
|
{""}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:halign "center"
|
:halign "center"
|
||||||
:onclick "hyprctl eval 'hl.dsp.focus({workspace=\"r+1\"})'"
|
:onclick "~/.config/scripts/workspacefocus/focusright.sh"
|
||||||
{""}
|
{""}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,14 @@ monitors_json=$(hyprctl monitors -j)
|
||||||
|
|
||||||
curmon=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .name')
|
curmon=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .name')
|
||||||
currot=$(echo "$monitors_json" | jq -r '.[] | select(.focused) | .transform')
|
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
|
# Calculate new rotation
|
||||||
if [[ "$direction" == "cw" ]]; then
|
if [[ "$direction" == "cw" ]]; then
|
||||||
|
|
@ -33,8 +41,8 @@ fi
|
||||||
|
|
||||||
echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)"
|
echo "Rotating monitor '$curmon' from $currot to $newrot ($direction)"
|
||||||
|
|
||||||
# Apply new rotation to monitor (hyprctl keyword doesn't work with Lua config)
|
# Apply new rotation while preserving current mode and scale
|
||||||
hyprctl eval "hl.monitor({output='$curmon', transform=$newrot})"
|
hyprctl eval "hl.monitor({output='$curmon', mode='$curmode', position='${curx}x${cury}', scale=$curscale, transform=$newrot})"
|
||||||
|
|
||||||
# Detect touchscreen device name
|
# Detect touchscreen device name
|
||||||
touchdev=$(hyprctl devices -j | jq -r '.touch[0].name // empty')
|
touchdev=$(hyprctl devices -j | jq -r '.touch[0].name // empty')
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
hyprctl dispatch 'hl.dsp.focus({ workspace = "r-1" })'
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
hyprctl dispatch 'hl.dsp.focus({ workspace = "r+1" })'
|
||||||
Loading…
Reference in New Issue