From 6a71647443fd6ee0e108e2eaaa4648c6cf53b0f3 Mon Sep 17 00:00:00 2001 From: Mattia98 Date: Sat, 21 Oct 2023 13:51:38 +0200 Subject: [PATCH] Add informative notifications Show notification when starting or updating discord --- discord.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/discord.sh b/discord.sh index 32fdb6a..255a731 100644 --- a/discord.sh +++ b/discord.sh @@ -25,12 +25,17 @@ function main() { # Compare version if [ $(version $CURR_VER) -lt $(version $LAST_VER) ]; then # We are outdated, need to update + msg "Updating Discord" update_discord; + else + msg "No update necessary" fi else + msg "Installing Discord for the first time" install_discord; fi # Ready to go, start Discord + msg "Starting Discord" start_discord; } @@ -70,4 +75,12 @@ function start_discord() { function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } +function msg() { + if hash notify-send ; then + notify-send -i discord "discord.sh" "$1" + else + echo "$1" + fi +} + main;