summaryrefslogtreecommitdiffstats
path: root/.local/bin/notes
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-06-11 10:53:52 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-06-11 10:53:52 +0200
commita5ebf64f09a05c4178159fd9a3c75c501d0fc7e8 (patch)
treed7241e27487023ab76bd4a47d392537eaf013d53 /.local/bin/notes
parent00ebc6f7baa7e9bf4c7f8124d2ed7678d7a01f87 (diff)
downloaddotfiles-a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8.tar.gz
dotfiles-a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8.zip
refactor: clean up notes launcher
Diffstat (limited to '.local/bin/notes')
-rwxr-xr-x.local/bin/notes16
1 files changed, 10 insertions, 6 deletions
diff --git a/.local/bin/notes b/.local/bin/notes
index 778138d..aa34960 100755
--- a/.local/bin/notes
+++ b/.local/bin/notes
@@ -1,13 +1,17 @@
#!/usr/bin/bash
set -euo pipefail
-app_name=notes
-if ! [[ -d $NOTES_DIR ]]; then
- notify-send --app-name="$app_name" --icon="accessories-text-editor" \
+APP_NAME=notes
+
+# Log with notify-send and exit 1
+err() {
+ notify-send --app-name="$APP_NAME" --icon="accessories-text-editor" \
"Neovim notes plugin" "$NOTES_DIR does not exist or is not a directory"
exit 1
-fi
+}
+
+[[ -d $NOTES_DIR ]] || err
cd "$NOTES_DIR"
-exec foot --app-id="$app_name" -- \
- tmux new-session -A -D -s "$app_name" -- \
+exec foot -- \
+ tmux new-session -A -D -s "$APP_NAME" -- \
nvim -c "NotesFindTags"