mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
33 lines
728 B
Bash
Executable File
33 lines
728 B
Bash
Executable File
#!/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
|