aboutsummaryrefslogtreecommitdiff
path: root/bin/gnome-move-windows
blob: 0b6c0ccf330676b651be51d1f5793131d863d1f1 (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 -xl  | awk '/ emacs/ {print $1}')"
communications="$(wmctrl -l |  awk '/ebex|lack|communications|notmuch|elfeed/ {print $1}')"
terminals="$(wmctrl -l  | awk '/Alacritty|kitty|terminal/ {print $1}')"
browsers="$(wmctrl -xl  | awk '/irefox|hrom/ {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
done

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