diff options
| author | Lukasz Kasprzak <lukasz.kasprzak@pm.me> | 2026-04-14 22:32:43 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukasz.kasprzak@pm.me> | 2026-04-14 22:32:43 +0200 |
| commit | 83f7fe4b8402bab171d110703a1b1115efbc9b28 (patch) | |
| tree | 19110702c7d740f6bd8ee4f5d2ebcb97442be237 /dmenu-memo | |
| parent | 51d43498b07dc97d795947964534f0903cd05db5 (diff) | |
| download | bin-83f7fe4b8402bab171d110703a1b1115efbc9b28.tar.gz bin-83f7fe4b8402bab171d110703a1b1115efbc9b28.zip | |
cleaned up many scrits and deleted some that were of no use; renamed a lot
Diffstat (limited to 'dmenu-memo')
| -rwxr-xr-x | dmenu-memo | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/dmenu-memo b/dmenu-memo deleted file mode 100755 index 597f191..0000000 --- a/dmenu-memo +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -OUTFILE="${OUTFILE:-$HOME/.notes}" -DMENU="${DMENU:-dmenu}" -PROMPT="${PROMPT:-Memo: }" - -# Optional dmenu theming -# shellcheck disable=SC1090 -[[ -r "${HOME}/.local/bin/dmenu-theming" ]] && . "${HOME}/.local/bin/dmenu-theming" - -notify() { - # $1: urgency (low|normal|critical), $2: message - if command -v notify-send >/dev/null 2>&1; then - notify-send -u "$1" "dmenu-memo" "$2" - fi -} - -die() { - notify critical "$1" - exit 1 -} - -# dmenu returns non-zero on ESC; treat as cancel -note="$( - printf "" \ - | ${DMENU} -p "$PROMPT" ${lines:-} ${colors:-} ${font:-} \ - || true -)" - -# Cancel / empty input: notify low, then exit quietly -if [[ -z "${note}" ]]; then - notify low "Cancelled (empty memo)" - exit 0 -fi - -ts="$(date '+%y:%m:%d %H:%M:%S')" - -{ - printf -- "# %s\n" "$ts" - printf -- "%s\n" "$note" - printf -- "---\n" -} >> "$OUTFILE" || die "Failed to write to $OUTFILE" - -notify normal "Saved to ~/.notes" - |
