Add multi-monitor support
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
24
hosts/common/configs/user/gui/hyprland/scripts/bind.sh
Normal file
24
hosts/common/configs/user/gui/hyprland/scripts/bind.sh
Normal 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
|
Reference in New Issue
Block a user