summaryrefslogtreecommitdiff
path: root/keyboard/dmenunametag
blob: 5d71e67816e0c8f12de0ad5e3d6ddc2a2a3fe259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
numtags=9
defnames="Code\nCompile\nTest\nDebug\nEdit"
while !([ $tagnum -ge 1 2>/dev/null ] && [ $tagnum -le $numtags ]); do
	tagnum=$(seq $numtags | dmenu -p "Choose tag: ")
	[ "$tagnum" = "" ] && exit
done
while [ "$action" != "Rename" ] && [ "$action" != "Remove" ]; do
	action=$(echo -n "Rename\nRemove" | dmenu -p "Would you like to rename or remove this tag $tagnum's label? ")
	[ "$action" = "" ] && exit
done
case $action in
	Rename)
		name="$(echo -n "$defnames" | dmenu -p "Rename tag $tagnum to: ")"
		[ "$name" = "" ] && exit
		nametag $tagnum n "$name"
	;;
	Remove)	nametag $tagnum r	;;
	*)	exit			;;
esac
# Force bar to update by setting the root name to itself since there is currently a bug in the window manager
#xsetroot -name "$(xprop -root WM_NAME | sed -n 's/^WM_NAME(STRING) = \"\(.*\)\"/\1/p')"