diff options
| -rwxr-xr-x | .local/bin/notes | 16 |
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" |
