-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor
29 lines (21 loc) · 858 Bytes
/
monitor
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
#!/usr/bin/env bash
# Primary monitor will have 1-9 workspaces and secondary monitor will have 10
# TODO: needs to setup for multiple monitors rn it is only for 2 monitors
mon_count=$(hyprctl monitors -j | jq ". | length")
if [ "$mon_count" -eq 1 ]; then
exit 0
fi
mapfile -t workspaces_on_primary < <(seq 1 9)
workspaces_on_secondary=(10)
primary=$(hyprctl monitors -j | jq ".[] | select(.id == 1) | .name")
secondary=$(hyprctl monitors -j | jq ".[] | select(.id == 0) | .name")
primary=$(echo "$primary" | tr -d '"')
secondary=$(echo "$secondary" | tr -d '"')
for i in "${workspaces_on_primary[@]}"; do
hyprctl dispatch moveworkspacetomonitor "$i" "$primary"
done
for i in "${workspaces_on_secondary[@]}"; do
hyprctl dispatch moveworkspacetomonitor "$i" "$secondary"
done
hyprctl dispatch workspace 1
hyprctl dispatch focusmonitor "$primary"