hc() {
herbstclient "$@"
}
+installed() {
+ type "$1" >/dev/null 2>&1
+}
+# $1: timeout
+notify() {
+ if installed dzen2; then
+ sed 's/\^/^^/g' | dzen2 -fg blue -bg yellow -y 15 -h 30 -p "$1"
+ elif installed xmessage; then
+ # Fallback solution, display first line of stdin.
+ read x
+ xmessage -timeout "$1" "$x" &
+ fi
+}
# Tell all clients the configuration file was reloaded. Should be the first
# command in the autostart file.
hc unlock
-# $1: timeout
-notify() {
- sed 's/\^/^^/g' | dzen2 -fg blue -bg yellow -y 15 -h 30 -p "$@"
-}
-
# To notify me if set -e has terminated the script (then this part won't get
# executed).
echo 'hlwm restarted' | notify 1