aboutsummaryrefslogtreecommitdiff
path: root/bin/gnome-move-windows
blob: 3ca3069bdfe7f2ac76d52b01ce04211215cbe199 (plain)
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
35
36
#!/bin/sh
# Move windows according to my workflow. Check bin/gnome-set-config to
# see its key-binding. Needs wmctrl.

# Move all windows to the primary display. If they're on the secondary
# display, and we try to move them to a workspace, it won't work.
for window_id in $(wmctrl -l | awk '{print $1}'); do
    wmctrl -i  -r $window_id -e 0,0,0,-1,-1
done

# Assign windows to predetermined workplaces
misc=$(wmctrl -l |  awk '/isco|eepa/ {print $1}')
main="$(wmctrl -l  | awk '/ main$/ {print $1}')"
communications="$(wmctrl -l |  awk '/Webex|Slack|communications/ {print $1}')"
terminals="$(wmctrl -l  | awk '/Alacritty|terminals$/ {print $1}')"
browsers="$(wmctrl -l  | awk '/Firefox|Chrom/ {print $1}')"

for window_id in $misc; do
    wmctrl -i -r $window_id -t 4
done

for window_id in $main; do
    wmctrl -i -r $window_id -t 0
done

for window_id in $browsers; do
    wmctrl -i -r $window_id -t 1
done

for window_id in $communications; do
    wmctrl -i -r $window_id -t 2
fi

for window_id in $terminals; do
    wmctrl -i -r $window_id -t 3
fi
nihil fit ex nihilo