summaryrefslogtreecommitdiff
path: root/hyprworkspaceswitch
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-09-06 10:34:05 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-09-06 10:34:05 +0800
commit01abbff07781d55101f5a347634de49631709579 (patch)
tree6069e2ea6e007ff932cdfa917d922b9b1c186230 /hyprworkspaceswitch
parent582c7ad0569e4bc52a86b38e9a51f07f41842e15 (diff)
more hyprland scripts
Diffstat (limited to 'hyprworkspaceswitch')
-rwxr-xr-xhyprworkspaceswitch14
1 files changed, 14 insertions, 0 deletions
diff --git a/hyprworkspaceswitch b/hyprworkspaceswitch
new file mode 100755
index 0000000..6d5a014
--- /dev/null
+++ b/hyprworkspaceswitch
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+cworkspace=$(hyprctl activeworkspace -j | jq '.id')
+
+echo $cworkspace
+echo $1
+if [ $cworkspace -eq $1 ]; then
+ exit 1
+elif [ $cworkspace -gt $1 ]; then
+ for ((i=$cworkspace; i>=$1+1; i--)); do hyprctl dispatch workspace -1; done
+elif [ $cworkspace -lt $1 ]; then
+ for ((i=$cworkspace; i<=$1-1; i++)); do hyprctl dispatch workspace +1; done
+fi
+