summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/rbar.sh
blob: 8297b71d021ce704b82279aae3e19376794236f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
setup_trap() {
	trap "rm -f -- ${HOME}/n/wmii*/rbar/${1}" EXIT
}

write() {
	dirs=("${HOME}"/n/wmii*/rbar/)
	sponge|tee -a "${dirs[@]/%/${1}}" > /dev/null
}

set -eE
shopt -s nullglob
case "$1" in
	1) left-click;;
	2) middle-click;;
	3) right-click;;
	*) update "$1";;
esac