From ed52cab7b8dc6211796385c98ad53cc0f6660a58 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 15 Oct 2019 20:31:57 +0200 Subject: Updated dunstifyIDs.sh so it dunstifies error messages. --- dunstifyIDs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dunstifyIDs.sh') diff --git a/dunstifyIDs.sh b/dunstifyIDs.sh index 1b795e3..0dcd77f 100755 --- a/dunstifyIDs.sh +++ b/dunstifyIDs.sh @@ -1,5 +1,10 @@ #!/bin/sh -# Obtain an id from ~/.config/dunst/dunstifyIDs by grepping a word. For using with dunstify for replaceable notifications. +# Obtain an id from ~/.config/dunst/dunstifyIDs by grepping a word. +# Use with dunstify for autoreplacing notifications by string identifier. -cat $HOME/.config/dunst/dunstifyIDs | grep $1 | awk '{print $2}' +configFile="$HOME/.config/dunst/dunstifyIDs" +[ ! -f "$configFile" ] && dunstify "'$configFile' missing!" && exit 1 +id="$(grep "$1" <"$configFile" | awk '{print $2}')" +[ -z "$id" ] && dunstify "'$1' ID not set in '$configFile'" && exit 1 +echo "$id" -- cgit v1.2.1