commit 2ea5b3218ed335ea2deaccfe3a6b94db72376e7f parent 0a53e63e20105489c663cdcfb9efbf43b338981b Author: JayVii <jayvii[AT]posteo[DOT]de> Date: Sat, 28 Aug 2021 15:55:42 +0200 Use Environment Variables; Print enabled Notifiers Diffstat:
M | im-notifier.sh | | | 27 | +++++++++++++++++++++------ |
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/im-notifier.sh b/im-notifier.sh @@ -1,14 +1,25 @@ #!/usr/bin/env bash # Set timings -POLLTIME=30 -TIMEOUT=25 +if [[ ! -z $POLLTIME ]]; then + POLLTIME=30 +fi +if [[ ! -z $TIMEOUT ]]; then + TIMEOUT=25 +fi # Telegram Settings -TELEGRAM=1 +if [[ ! -z $TELEGRAM ]] && [[ ! -z $(command -v telegram-cli) ]]; then + TELEGRAM=1 + echo "Enabling Telegram!" +fi +if [[ ! -z $TG_ICON ]]; then + TG_ICON="document-send" +fi +if [[ ! -z $TG_ACTION ]]; then + TG_ACTION="telegram-desktop" +fi TG_NOTIFICATION_ID=0 -TG_ICON="document-send" # or "telegram", if installed -TG_ACTION="telegram-desktop" # Modules --------------------------------------------------------------------- @@ -71,7 +82,11 @@ function tg_notify { # Run Daemon ------------------------------------------------------------------ # Notify user about running state of the daemon -im_notify "IM-Notifier" 0 "gnome-settings" "IM-Notifier is running..." "[]" +INITMSG="Enabled Services:" +if [[ "$TELEGRAM" == "1" ]]; then + INITMSG="$INITMSG Telegram" +fi +im_notify "IM-Notifier" 0 "gnome-settings" "$INITMSG" "[]" # Run Signal Listener im_signal_listen &