#!/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')"