Skip to content

Commit

Permalink
Add informative notifications
Browse files Browse the repository at this point in the history
Show notification when starting or updating discord
  • Loading branch information
Mattia98 committed Oct 21, 2023
1 parent 508d132 commit 6a71647
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions discord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;

0 comments on commit 6a71647

Please sign in to comment.