diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-11 10:53:52 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-11 10:53:52 +0200 |
| commit | a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8 (patch) | |
| tree | d7241e27487023ab76bd4a47d392537eaf013d53 | |
| parent | 00ebc6f7baa7e9bf4c7f8124d2ed7678d7a01f87 (diff) | |
| download | dotfiles-a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8.tar.gz dotfiles-a5ebf64f09a05c4178159fd9a3c75c501d0fc7e8.zip | |
refactor: clean up notes launcher
| -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" |
