diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-09 10:25:24 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-09 10:25:24 +0200 |
| commit | 5a83f46dad793b35aaba130672097363d27c4c51 (patch) | |
| tree | d996b1ac80f75b948597626fec9f1a0357c6c2b5 /.local | |
| parent | e7a4394162888cc316dfcdd18341d859bdf0270b (diff) | |
| download | dotfiles-5a83f46dad793b35aaba130672097363d27c4c51.tar.gz dotfiles-5a83f46dad793b35aaba130672097363d27c4c51.zip | |
misc: add notes dir sanity check for notes launcher
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/notes | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/.local/bin/notes b/.local/bin/notes index 05ca7c2..cdafd6b 100755 --- a/.local/bin/notes +++ b/.local/bin/notes @@ -1,9 +1,15 @@ #!/usr/bin/bash set -euo pipefail +app_name=notes +if ! [[ -d $NOTES_DIR ]]; then + notify-send --app-name="$app_name" --icon="accessories-text-editor" \ + "Notes" "Could not open NOTES_DIR ($NOTES_DIR)" + exit 1 +fi +cd "$NOTES_DIR" # Open the notes directory in foot, inside a persistent tmux session named # "notes" (stolen if it already exists), landing straight into an fzf picker -cd "$NOTES_DIR" -exec foot --app-id=notes -- \ - tmux new-session -A -D -s notes -- \ +exec foot --app-id="$app_name" -- \ + tmux new-session -A -D -s "$app_name" -- \ nvim -c "NotesFindTags" |
