imprv: set terminal title

This commit is contained in:
2025-07-10 09:37:18 +02:00
parent ded6a686fd
commit 1f15d53c32
3 changed files with 11 additions and 3 deletions

View File

@@ -78,6 +78,9 @@ item_types = ["VJOURNAL", "VTODO"]
You may also specify the location of the configuration file with the environment `CONFIGFILE`.
By default, `fzf-vjour` sets a descriptive terminal title.
This can be bypassed by specyfing `SET_TERMINAL_TITLE="no"` in the configuration file.
Usage
-----
Use the default `fzf` keys to navigate your notes, e.g., `ctrl-j` and `ctrl-k` for going down/up in the list.

View File

@@ -2,9 +2,6 @@
set -eu
# Set terminal title
printf '\033]0;%s\007' "fzf-vjour | Journal, notes, and tasks"
# Always load functions
# Helper functions
. "sh/helper.sh"
@@ -122,6 +119,11 @@ if [ -n "${list_option:-}" ]; then
exit 0
fi
# Set terminal title
if [ "$SET_TERMINAL_TITLE" = "yes" ]; then
printf '\033]0;%s\007' "$TERMINAL_TITLE"
fi
while true; do
query=$(stripws "$query")
selection=$(

View File

@@ -1,4 +1,5 @@
CONFIGFILE="${CONFIGFILE:-$HOME/.config/fzf-vjour/config}"
export TERMINAL_TITLE="🗃️ fzf-vjour | Journal, notes, and tasks"
if [ ! -f "$CONFIGFILE" ]; then
err "Configuration '$CONFIGFILE' not found."
exit 1
@@ -14,9 +15,11 @@ if [ ! -d "$ROOT" ]; then
exit 1
fi
SYNC_CMD="${SYNC_CMD:-}"
SET_TERMINAL_TITLE="${SET_TERMINAL_TITLE:-yes}"
export ROOT
export SYNC_CMD
export COLLECTION_LABELS
export SET_TERMINAL_TITLE
for i in $(seq 9); do
collection=$(printf "%s" "$COLLECTION_LABELS" | cut -d ';' -f "$i" | cut -d '=' -f 1)
label=$(printf "%s" "$COLLECTION_LABELS" | cut -d ';' -f "$i" | cut -d '=' -f 2)