Skip to content

Commit b463cb8

Browse files
committed
fix(notification): set app icon with the new libnotify -n / --app-name option (#492)
Since `libnotify` 0.8.8, `notify-send` now differanciate App icons and notification icons with the former overlapping the later in the bottom left corner (depending on the underlying notification server implementation). This looks cool in most cases but looks weird for Arch-Update (see screenshot below). Fortunately, `libnotify` 0.8.8 added [a new `-n / --app-icon` option](https://gitlab.gnome.org/GNOME/libnotify/-/commit/1f3fdd1e4490cb9b9b10b2cdb1a2472212bc67e5) for `notify-send` that allows to overwrite the App icon (basically what the `-i / --icon` option used to do before App icons and notification icons got "separated"). We are therefore switching from the `-i` option to `-n` option with `notify-send` to preserve the current behavior with latest `libnotify`. <img width="494" height="145" alt="2026-01-11_23-59" src="https://github.com/user-attachments/assets/9158f13c-c315-4c93-ba44-2cd85d7db98a" />
1 parent 03c3dba commit b463cb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/notification.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
if [ "${update_number}" -eq 1 ]; then
1414
if [ -z "${last_notif_id}" ]; then
1515
# shellcheck disable=SC2154
16-
notify-send -p -a "${_name}" -i "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} update available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
16+
notify-send -p -a "${_name}" -n "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} update available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
1717
else
1818
# shellcheck disable=SC2154
19-
notify-send -p -r "${last_notif_id}" -a "${_name}" -i "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} update available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
19+
notify-send -p -r "${last_notif_id}" -a "${_name}" -n "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} update available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
2020
fi
2121
else
2222
if [ -z "${last_notif_id}" ]; then
23-
notify-send -p -a "${_name}" -i "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} updates available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
23+
notify-send -p -a "${_name}" -n "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} updates available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
2424
else
25-
notify-send -p -r "${last_notif_id}" -a "${_name}" -i "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} updates available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
25+
notify-send -p -r "${last_notif_id}" -a "${_name}" -n "${name}_updates-available-${tray_icon_style}" "${_name}" "$(eval_gettext "\${update_number} updates available")" -A "run=$(eval_gettext "Run \${_name}")" -A "close=$(eval_gettext "Close")" > "${tmpdir}/notif_param"
2626
fi
2727
fi
2828

0 commit comments

Comments
 (0)