summaryrefslogtreecommitdiff
path: root/hyprworkspaceswitch
blob: 6d5a014cf2a5869f5a93a22476a028d477facb7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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