zsh:alias: Turn tmsu into a smarter function

Instead of simply pointing the database to XDG_DATA_HOME, write a
wrapper function that searches for `.tmsu/db` in all parent directories
and fallbacks to XDG_DATA_HOME if not found.

Also create XDG_DATA_HOME/tmsu if necessary.
This commit is contained in:
2022-09-18 19:33:51 +02:00
parent 2177031c68
commit 553a2679cf
2 changed files with 25 additions and 1 deletions

View File

@@ -44,7 +44,6 @@ fi
# XDG Base Directory Specification
add_flags tmux -f "${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
add_flags tmsu -D "${XDG_DATA_HOME:-$HOME/.local/share}/tmsu/db"
add_flags yarn --use-yarnrc "${XDG_CONFIG_HOME:-$HOME/.config}"/yarn/config
add_flags bash --rcfile "${XDG_CONFIG_HOME:-$HOME/.config}"/bash/bashrc
add_flags mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc