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

emacs_main="$(wmctrl -l  | awk '/ main$/ {print $1}')"
emacs_communications="$(wmctrl -l  | awk '/ communications$/ {print $1}')"
emacs_terminals="$(wmctrl -l  | awk '/ terminals$/ {print $1}')"
browsers="$(wmctrl -l  | grep -i -e firefox -e chrom | awk '{print $1}' | tr '\n' ' ')"

if [ -n "$emacs_main" ]; then
    wmctrl -i -r $emacs_main -t 0
fi

if [ -n "$emacs_communications" ]; then
    wmctrl -i -r $emacs_communications -t 2
fi

if [ -n "$emacs_terminals" ]; then
    wmctrl -i -r $emacs_terminals -t 3
fi

for browser in $browsers; do
    wmctrl -i -r $browser -t 1
done
nihil fit ex nihilo