Add multi-monitor support

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-14 20:24:25 +00:00
parent c4d8cc951d
commit ce96ec6bf7
7 changed files with 163 additions and 81 deletions

View File

@@ -0,0 +1,24 @@
BASE_WS="$1"
ACTION="$2"
current_ws_id="$(hyprctl -j activeworkspace | jq -r '.id')"
ws_json="$(hyprctl -j workspaces)"
max_ws_id="$(echo "$ws_json" | jq -r '[.[] | .id] | max')"
BLOCK_SIZE=10
total_blocks=$(((max_ws_id - 1) / BLOCK_SIZE + 1))
current_block=$(((current_ws_id - 1) / BLOCK_SIZE))
target_ws=$((current_block * BLOCK_SIZE + BASE_WS))
if [ "$target_ws" -eq "$current_ws_id" ]; then
next_block=$(( (current_block + 1) % total_blocks ))
target_ws=$(( next_block * BLOCK_SIZE + BASE_WS ))
fi
if [ "$ACTION" = "move" ]; then
hyprctl dispatch movetoworkspacesilent "$target_ws"
else
hyprctl dispatch workspace "$target_ws"
fi