diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-02 12:16:38 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-02 12:16:38 -0500 |
| commit | b10cba594db836c0747066addad48bda4d30cd02 (patch) | |
| tree | 063119a623fa3f7139feda4ef302896d8f5f934c /dotfiles/common/.local/bin/notify | |
| parent | 49c2ba9c4510bf6e1acd306687473bc8ba9ad8dd (diff) | |
| download | archsetup-b10cba594db836c0747066addad48bda4d30cd02.tar.gz archsetup-b10cba594db836c0747066addad48bda4d30cd02.zip | |
refactor: drop in-repo dotfiles/, move stow tooling to the dotfiles repo
Since the installer clones DOTFILES_REPO into ~/.dotfiles and stows from there, the in-repo dotfiles/ tree was dead weight. Nothing reads it at install time. I removed it (831 files) now that both machines are migrated.
The Makefile's stow / restow / reset / unstow / import targets and the dotfile-script unit suites moved to the dotfiles repo. They sit alongside the scripts they manage and run standalone (cd ~/.dotfiles && make ...). This Makefile keeps the VM-integration targets and the installer-helper suite (safe-rm-rf).
I updated CLAUDE.md and README.md so stow operations run from ~/.dotfiles, and the dotfile-management, theme, and unit-test sections point at the standalone repo. The README was already describing the old in-repo model from before the installer switched to cloning. This brings it in line.
Diffstat (limited to 'dotfiles/common/.local/bin/notify')
| -rwxr-xr-x | dotfiles/common/.local/bin/notify | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/dotfiles/common/.local/bin/notify b/dotfiles/common/.local/bin/notify deleted file mode 100755 index 6918e01..0000000 --- a/dotfiles/common/.local/bin/notify +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash -# -# notify - Display notifications with icons and sounds -# -# Usage: -# notify <type> "title" "body" [--persist] [--silent] -# -# 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) -# --silent Show the notification but play no sound -# -# Environment: -# NOTIFY_VOLUME Playback volume for the sound (paplay scale: 65536 = 100%). -# Lower it to soften every notification without re-encoding -# the sound files. Default 65536. -# -# Examples: -# notify success "Job Complete" "Download finished in 12 minutes" -# notify fail "Job Failed" "Connection refused" --persist -# notify info "Touchpad" "Disabled" --silent - -set -euo pipefail - -ICON_DIR="$HOME/.local/share/icons/notify" -SOUND_DIR="$HOME/.local/share/sounds/notify" - -usage() { - cat <<EOF -Usage: notify <type> "title" "body" [--persist] [--silent] - -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 - --silent Show the notification but play no sound - -Environment: - NOTIFY_VOLUME Sound playback volume (paplay scale: 65536 = 100%) - -Examples: - notify success "Job Complete" "Download finished" - notify fail "Build Failed" "Test errors" --persist - notify info "Touchpad" "Disabled" --silent -EOF - exit 1 -} - -# Require at least type, title, body -if [[ $# -lt 3 ]]; then - usage -fi - -TYPE="$1" -TITLE="$2" -BODY="$3" -shift 3 - -# Optional flags, in any order -PERSIST="" -SILENT="" -for arg in "$@"; do - case "$arg" in - --persist) PERSIST="--persist" ;; - --silent) SILENT=1 ;; - *) - echo "Error: Unknown option '$arg'" >&2 - usage - ;; - esac -done - -# Master playback volume (paplay scale: 65536 = 100%) -NOTIFY_VOLUME="${NOTIFY_VOLUME:-65536}" - -# 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 (unless silenced, and if the file exists) -if [[ -z "$SILENT" && -f "$SOUND" ]]; then - paplay --volume="$NOTIFY_VOLUME" "$SOUND" & -fi - -# Send notification -notify-send "${NOTIFY_ARGS[@]}" "$TITLE" "$BODY" |
