added cycling of workspaces for honney-main

This commit is contained in:
Hannes
2026-07-05 18:24:49 +02:00
parent 05a4580e67
commit 791b34e7e4
2 changed files with 65 additions and 3 deletions
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
BASE=$1
ACTION=$2
case $BASE in
1) GROUP="1 10 11 12" ;;
2) GROUP="2 20 21 22" ;;
3) GROUP="3 30 31 32" ;;
4) GROUP="4 40 41 42" ;;
*) exit 1 ;;
esac
CURRENT=$(hyprctl activeworkspace -j 2>/dev/null | jq '.id')
NEXT=""
FOUND=0
for WS in $GROUP; do
if [ "$FOUND" = "1" ]; then
NEXT=$WS
break
fi
[ "$WS" = "$CURRENT" ] && FOUND=1
done
if [ -z "$NEXT" ] && [ "$FOUND" = "1" ]; then
NEXT=$(echo "$GROUP" | awk '{print $1}')
fi
if [ -z "$NEXT" ]; then
for WS in $GROUP; do
[ "$WS" = "$BASE" ] && continue
for MWS in $(hyprctl monitors -j 2>/dev/null | jq '.[].activeWorkspace.id'); do
if [ "$WS" = "$MWS" ]; then
NEXT=$WS
break 2
fi
done
done
[ -z "$NEXT" ] && NEXT=$BASE
fi
case $ACTION in
focus)
hyprctl dispatch "hl.dsp.focus({ workspace = \"$NEXT\" })"
;;
move)
hyprctl dispatch "hl.dsp.window.move({ workspace = \"$NEXT\", follow = false })"
;;
move_follow)
hyprctl dispatch "hl.dsp.window.move({ workspace = \"$NEXT\", follow = true })"
;;
esac