From a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 11 Jun 2026 10:53:52 +0200 Subject: refactor: clean up notes launcher --- .local/bin/notes | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to '.local') 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" -- cgit v1.3.1