Fix hyprland bind script

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-16 19:48:34 +00:00
parent 2888bb8b72
commit 0799ab4db7
2 changed files with 21 additions and 24 deletions

View File

@@ -1,7 +1,16 @@
# shellcheck shell=bash
MOVE=false
while getopts "m" opt; do
case $opt in
m) MOVE=true ;;
*) exit 1 ;;
esac
done
shift $((OPTIND - 1))
SELECTED_WORKSPACE_BASE="$1"
ACTION="$2"
BLOCK_SIZE=10
@@ -19,7 +28,7 @@ if [ "$target_workspace_id" -eq "$current_workspace_id" ]; then
target_workspace_id=$((next_block * BLOCK_SIZE + SELECTED_WORKSPACE_BASE))
fi
if [ "$ACTION" = "move" ]; then
if [ "$MOVE" = true ]; then
hyprctl dispatch movetoworkspacesilent "$target_workspace_id"
else
hyprctl dispatch workspace "$target_workspace_id"