From 0e73ece20fff75c50a09bda41b82ecfa1655292d Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 2 Feb 2026 03:10:50 -0600 Subject: feat(dotfiles): add notify notification system Script with type-specific icons and sounds for success, fail, alert, question, alarm, info, security, and bug notifications. --- dotfiles/common/.local/bin/notify | 138 +++++++++++++++++++++ .../common/.local/share/icons/notify/alarm.png | Bin 0 -> 55664 bytes .../common/.local/share/icons/notify/alert.png | Bin 0 -> 66016 bytes dotfiles/common/.local/share/icons/notify/bug.png | Bin 0 -> 60772 bytes dotfiles/common/.local/share/icons/notify/fail.png | Bin 0 -> 77513 bytes dotfiles/common/.local/share/icons/notify/info.png | Bin 0 -> 66060 bytes .../common/.local/share/icons/notify/question.png | Bin 0 -> 75683 bytes .../common/.local/share/icons/notify/security.png | Bin 0 -> 64253 bytes .../common/.local/share/icons/notify/success.png | Bin 0 -> 75824 bytes .../common/.local/share/sounds/notify/alarm.ogg | Bin 0 -> 45775 bytes .../common/.local/share/sounds/notify/alert.ogg | Bin 0 -> 41684 bytes dotfiles/common/.local/share/sounds/notify/bug.ogg | Bin 0 -> 10187 bytes .../common/.local/share/sounds/notify/fail.ogg | Bin 0 -> 74886 bytes .../common/.local/share/sounds/notify/info.ogg | Bin 0 -> 31466 bytes .../common/.local/share/sounds/notify/question.ogg | Bin 0 -> 49846 bytes .../common/.local/share/sounds/notify/security.ogg | Bin 0 -> 19910 bytes .../common/.local/share/sounds/notify/success.ogg | Bin 0 -> 39244 bytes 17 files changed, 138 insertions(+) create mode 100755 dotfiles/common/.local/bin/notify create mode 100644 dotfiles/common/.local/share/icons/notify/alarm.png create mode 100644 dotfiles/common/.local/share/icons/notify/alert.png create mode 100644 dotfiles/common/.local/share/icons/notify/bug.png create mode 100644 dotfiles/common/.local/share/icons/notify/fail.png create mode 100644 dotfiles/common/.local/share/icons/notify/info.png create mode 100644 dotfiles/common/.local/share/icons/notify/question.png create mode 100644 dotfiles/common/.local/share/icons/notify/security.png create mode 100644 dotfiles/common/.local/share/icons/notify/success.png create mode 100644 dotfiles/common/.local/share/sounds/notify/alarm.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/alert.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/bug.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/fail.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/info.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/question.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/security.ogg create mode 100644 dotfiles/common/.local/share/sounds/notify/success.ogg (limited to 'dotfiles/common/.local') diff --git a/dotfiles/common/.local/bin/notify b/dotfiles/common/.local/bin/notify new file mode 100755 index 0000000..a89a3ff --- /dev/null +++ b/dotfiles/common/.local/bin/notify @@ -0,0 +1,138 @@ +#!/bin/bash +# +# notify - Display notifications with icons and sounds +# +# Usage: +# notify "title" "body" [--persist] +# +# Types: +# success - Green checkmark, pleasant chime +# fail - Red X, warning tone +# alert - Yellow exclamation, attention tone +# question - Blue question mark, contemplative tone +# alarm - Alarm clock icon, alarm sound +# info - Blue info icon, confident tone +# security - Shield icon, security tone +# bug - Bug icon, error tone +# +# Options: +# --persist Don't auto-dismiss (stays until manually closed) +# +# Examples: +# notify success "Job Complete" "Download finished in 12 minutes" +# notify fail "Job Failed" "Connection refused" --persist +# notify alert "Warning" "Network speed reduced" +# notify question "Input Needed" "Continue or abort?" + +set -euo pipefail + +ICON_DIR="$HOME/.local/share/icons/notify" +SOUND_DIR="$HOME/.local/share/sounds/notify" + +usage() { + cat < "title" "body" [--persist] + +Types: + success Green checkmark, pleasant chime + fail Red X, warning tone + alert Yellow exclamation, attention tone + question Blue question mark, contemplative tone + alarm Alarm clock, alarm sound + info Blue info icon, confident tone + security Shield icon, security tone + bug Bug icon, error tone + +Options: + --persist Don't auto-dismiss notification + +Examples: + notify success "Job Complete" "Download finished" + notify fail "Build Failed" "Test errors" --persist +EOF + exit 1 +} + +# Require at least type, title, body +if [[ $# -lt 3 ]]; then + usage +fi + +TYPE="$1" +TITLE="$2" +BODY="$3" +PERSIST="${4:-}" + +# Validate type and set icon/sound +case "$TYPE" in + success) + ICON="$ICON_DIR/success.png" + SOUND="$SOUND_DIR/success.ogg" + ;; + fail) + ICON="$ICON_DIR/fail.png" + SOUND="$SOUND_DIR/fail.ogg" + ;; + alert) + ICON="$ICON_DIR/alert.png" + SOUND="$SOUND_DIR/alert.ogg" + ;; + question) + ICON="$ICON_DIR/question.png" + SOUND="$SOUND_DIR/question.ogg" + ;; + alarm) + ICON="$ICON_DIR/alarm.png" + SOUND="$SOUND_DIR/alarm.ogg" + ;; + info) + ICON="$ICON_DIR/info.png" + SOUND="$SOUND_DIR/info.ogg" + ;; + security) + ICON="$ICON_DIR/security.png" + SOUND="$SOUND_DIR/security.ogg" + ;; + bug) + ICON="$ICON_DIR/bug.png" + SOUND="$SOUND_DIR/bug.ogg" + ;; + *) + echo "Error: Unknown type '$TYPE'" >&2 + echo "Valid types: success, fail, alert, question, alarm, info, security, bug" >&2 + exit 1 + ;; +esac + +# Check assets exist +if [[ ! -f "$ICON" ]]; then + echo "Warning: Icon not found: $ICON" >&2 +fi + +if [[ ! -f "$SOUND" ]]; then + echo "Warning: Sound not found: $SOUND" >&2 +fi + +# Build notify-send arguments +NOTIFY_ARGS=( + --app-name="" + --urgency=normal +) + +# Add persist flag if requested +if [[ "$PERSIST" == "--persist" ]]; then + NOTIFY_ARGS+=(--expire-time=0) +fi + +# Add icon if it exists +if [[ -f "$ICON" ]]; then + NOTIFY_ARGS+=(--icon="$ICON") +fi + +# Play sound in background (if it exists) +if [[ -f "$SOUND" ]]; then + paplay "$SOUND" & +fi + +# Send notification +notify-send "${NOTIFY_ARGS[@]}" "$TITLE" "$BODY" diff --git a/dotfiles/common/.local/share/icons/notify/alarm.png b/dotfiles/common/.local/share/icons/notify/alarm.png new file mode 100644 index 0000000..23e1374 Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/alarm.png differ diff --git a/dotfiles/common/.local/share/icons/notify/alert.png b/dotfiles/common/.local/share/icons/notify/alert.png new file mode 100644 index 0000000..7c9fda9 Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/alert.png differ diff --git a/dotfiles/common/.local/share/icons/notify/bug.png b/dotfiles/common/.local/share/icons/notify/bug.png new file mode 100644 index 0000000..9ea84cf Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/bug.png differ diff --git a/dotfiles/common/.local/share/icons/notify/fail.png b/dotfiles/common/.local/share/icons/notify/fail.png new file mode 100644 index 0000000..ea0fbbe Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/fail.png differ diff --git a/dotfiles/common/.local/share/icons/notify/info.png b/dotfiles/common/.local/share/icons/notify/info.png new file mode 100644 index 0000000..e2acdb4 Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/info.png differ diff --git a/dotfiles/common/.local/share/icons/notify/question.png b/dotfiles/common/.local/share/icons/notify/question.png new file mode 100644 index 0000000..fd1a4ad Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/question.png differ diff --git a/dotfiles/common/.local/share/icons/notify/security.png b/dotfiles/common/.local/share/icons/notify/security.png new file mode 100644 index 0000000..a48799c Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/security.png differ diff --git a/dotfiles/common/.local/share/icons/notify/success.png b/dotfiles/common/.local/share/icons/notify/success.png new file mode 100644 index 0000000..892ef3c Binary files /dev/null and b/dotfiles/common/.local/share/icons/notify/success.png differ diff --git a/dotfiles/common/.local/share/sounds/notify/alarm.ogg b/dotfiles/common/.local/share/sounds/notify/alarm.ogg new file mode 100644 index 0000000..b4dff15 Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/alarm.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/alert.ogg b/dotfiles/common/.local/share/sounds/notify/alert.ogg new file mode 100644 index 0000000..217f33a Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/alert.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/bug.ogg b/dotfiles/common/.local/share/sounds/notify/bug.ogg new file mode 100644 index 0000000..6842082 Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/bug.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/fail.ogg b/dotfiles/common/.local/share/sounds/notify/fail.ogg new file mode 100644 index 0000000..916d88a Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/fail.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/info.ogg b/dotfiles/common/.local/share/sounds/notify/info.ogg new file mode 100644 index 0000000..57900b4 Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/info.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/question.ogg b/dotfiles/common/.local/share/sounds/notify/question.ogg new file mode 100644 index 0000000..8e44c55 Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/question.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/security.ogg b/dotfiles/common/.local/share/sounds/notify/security.ogg new file mode 100644 index 0000000..301287e Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/security.ogg differ diff --git a/dotfiles/common/.local/share/sounds/notify/success.ogg b/dotfiles/common/.local/share/sounds/notify/success.ogg new file mode 100644 index 0000000..c28da65 Binary files /dev/null and b/dotfiles/common/.local/share/sounds/notify/success.ogg differ -- cgit v1.2.3