-
Notifications
You must be signed in to change notification settings - Fork 1
/
ws-switch.sh
34 lines (31 loc) · 1 KB
/
ws-switch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Set the number of your first/main monitor, find it under `hyrpctl monitors` then find your monitor and it is the ID: value at the top.
first=1
# Set the number of your secondary monitor
second=0
# Set the number of your third monitor
# third=2
# Set the number of workspaces per screen
ws_per_monitor=3
monitor=$(hyprctl activeworkspace | grep -E "monitorID: " | sed -e 's/^[ \t]*//')
if [[ $monitor == *"$first"* ]]; then
if [[ $2 == "move" ]]; then
hyprctl dispatch movetoworkspace $1
else
hyprctl dispatch workspace $1
fi
elif [[ $monitor == *"$second"* ]]; then
calc=$(($1 + $ws_per_monitor))
if [[ $2 == "move" ]]; then
hyprctl dispatch movetoworkspace $calc
else
hyprctl dispatch workspace $calc
fi
# elif [[ $monitor == *"$third"* ]]; then
# calc=$(($1 + ($ws_per_monitor * 2)))
# if [[ $2 == "move" ]]; then
# hyprctl dispatch movetoworkspace $calc
# else
# hyprctl dispatch workspace $calc
# fi
fi