Skip to content

Commit

Permalink
chore: Improve logic for the 'NoNotification' option (#307)
Browse files Browse the repository at this point in the history
Only check for 'notify-send' presence if the NoNotification option is not set
  • Loading branch information
Antiz96 authored Jan 27, 2025
1 parent 1960ddd commit daa9d7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sed -ri 's/\x1B\[[0-9;]*m//g' "${statedir}/current_updates_check"
if [ -n "${update_available}" ]; then
icon_updates-available

if [ -n "${notification_support}" ] && [ -z "${no_notification}" ]; then
if [ -n "${notification_support}" ]; then
if ! diff "${statedir}/current_updates_check" "${statedir}/last_updates_check" &> /dev/null; then
update_number=$(wc -l "${statedir}/current_updates_check" | awk '{print $1}')
# shellcheck disable=SC2154
Expand Down
6 changes: 4 additions & 2 deletions src/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ fi
flatpak_support=$(command -v flatpak)

# Check if notify-send is installed for the optional desktop notification support
# shellcheck disable=SC2034
notification_support=$(command -v notify-send)
if [ -z "${no_notification}" ]; then
# shellcheck disable=SC2034
notification_support=$(command -v notify-send)
fi

# Definition of the elevation command to use (depending on which one is installed on the system and if it's not already defined in arch-update.conf)
if [ -z "${su_cmd}" ]; then
Expand Down

0 comments on commit daa9d7a

Please sign in to comment.