Extract notification command for using the correct spacing

This commit is contained in:
David Heinemeier Hansson
2026-05-08 09:01:09 +02:00
parent a43c304d21
commit 5971bab9d1
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# omarchy:summary=Send a desktop notification with Omarchy glyph and body spacing
# omarchy:args=<glyph> <headline> [description] [notify-send options]
# omarchy:examples=omarchy notification send "󰔛" "Reminder" "5 minutes are up" -u critical
set -euo pipefail
if (($# < 2)); then
echo "Usage: omarchy-notification-send <glyph> <headline> [description] [notify-send options]"
exit 1
fi
glyph=$1
headline=$2
description=${3:-}
shift 2
if (($# > 0)) && [[ $1 != -* ]]; then
shift
else
description=""
fi
summary="$glyph $headline"
if [[ -n $description ]]; then
description=$(sed 's/^/ /' <<<"$description")
notify-send "$@" "$summary" "$description"
else
notify-send "$@" "$summary"
fi