aboutsummaryrefslogtreecommitdiff
path: root/home/bin/sw
blob: f021d7f5351287f3f685a68dcbd4bc2d39229ab3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Switch workspace between a specified primary one and the current one.

PRIMARY=0
CURRENT=$(wmctrl -d | grep \* | cut -d " " -f1)

SAVE_FILE=/tmp/current-workspace

if [ "$CURRENT" = "$PRIMARY" ] && [ -e "$SAVE_FILE" ]; then
    wmctrl -s $(cat "$SAVE_FILE")
else
    echo "$CURRENT" > "$SAVE_FILE"
    wmctrl -s $PRIMARY
fi