Send notifications via the Notify D-Bus method, never notify-send

omarchy-notification-send now calls org.freedesktop.Notifications.Notify
directly with `busctl --user`, instead of shelling out to notify-send. Each
value is one typed D-Bus parameter, so there is no argv/option layer that could
reinterpret a relayed headline like `--hint=…` or `-rf` as an option or a hint:
the summary and body are strings, and omarchy-exec-argv is built only from
--exec. A leading `--` keeps busctl's own getopt from reading a dash-leading
value as a busctl option.

Map -i to app_icon, -t to expire_timeout, and urgency to the byte hint; unknown
options are now a hard error rather than a silent pass-through. Route the unused
hypr o.notify helper and the sample hooks through the wrapper too, and tighten
the bin-style test so nothing under bin/ may call notify-send. The test stubs
busctl and trips if notify-send is invoked.
This commit is contained in:
Ryan Hughes
2026-08-23 17:02:29 -04:00
parent be63983d16
commit e3729a385b
10 changed files with 206 additions and 147 deletions
@@ -4,4 +4,4 @@
# To put it into use, remove .sample from this file name.
# Example: Show the name of the font that was just set.
# notify-send -u low "New font" "Your new font is $1"
# omarchy-notification-send -u low "New font" "Your new font is $1"
@@ -6,5 +6,5 @@
weather=$(omarchy-weather-status 2>/dev/null) || true
if [[ -n $weather && $weather != "Weather unavailable" ]]; then
notify-send -u low "$weather"
omarchy-notification-send -u low "$weather"
fi
@@ -4,4 +4,4 @@
# To put it into use, remove .sample from this file name.
# Example: Show notification after the system has been updated.
# notify-send -u low "Update Performed" "Your system is now up to date"
# omarchy-notification-send -u low "Update Performed" "Your system is now up to date"
@@ -4,4 +4,4 @@
# To put it into use, remove .sample from this file name.
# Example: Show the name of the theme that was just set.
# notify-send -u low "New theme" "Your new theme is $1"
# omarchy-notification-send -u low "New theme" "Your new theme is $1"