summaryrefslogtreecommitdiffstats
path: root/.local/bin/notes
blob: cdafd6b04123ed5ed7778672acb1d06449d57752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
exec foot --app-id="$app_name" -- \
	tmux new-session -A -D -s "$app_name" -- \
	nvim -c "NotesFindTags"