diff options
Diffstat (limited to 'dotfiles/system/.profile.d')
| -rw-r--r-- | dotfiles/system/.profile.d/fzf.sh | 19 | ||||
| -rwxr-xr-x[-rw-r--r--] | dotfiles/system/.profile.d/zoxide.sh | 2 |
2 files changed, 17 insertions, 4 deletions
diff --git a/dotfiles/system/.profile.d/fzf.sh b/dotfiles/system/.profile.d/fzf.sh index bd26d02..5fab752 100644 --- a/dotfiles/system/.profile.d/fzf.sh +++ b/dotfiles/system/.profile.d/fzf.sh @@ -13,6 +13,10 @@ export FZF_DEFAULT_COMMAND='rg --files' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden' +# Directory paths for convenience functions +IF_GAMES_DIR="$HOME/sync/org/text.games" +BOOKS_DIR="$HOME/sync/books" + ### NAVIGATION # cdff - change directory find file @@ -67,12 +71,21 @@ fif() { ### CONVENIENCE -# Find a book in the calibre library and open it in emacs client. +# Find an epub book in the library and open it in epr terminal reader. # previously: find ~/books \( -iname \*.epub -o -iname \*.pdf -o -iname \*.djvu \) | fzf | xargs emacs bk() { - bkfile=$(find ~/sync/books/ \( -iname "*.pdf" -o -iname "*.epub" -o -iname "*.djvu" \) -print | fzf) + bkfile=$(find "$BOOKS_DIR" -iname "*.epub" -print | fzf) if [ -n "$bkfile" ]; then - emacsclient -c -a '' "$bkfile" & + epr "$bkfile" + fi +} + +# Find an interactive fiction game and open it in frotz. +# Supports Z-machine files (.z1-.z8, .zblorb, .blorb) +tg() { + gamefile=$(find "$IF_GAMES_DIR" -type f \( -iname "*.z[1-8]" -o -iname "*.zblorb" -o -iname "*.blorb" \) -print | fzf) + if [ -n "$gamefile" ]; then + frotz "$gamefile" fi } diff --git a/dotfiles/system/.profile.d/zoxide.sh b/dotfiles/system/.profile.d/zoxide.sh index a748043..8bbb86b 100644..100755 --- a/dotfiles/system/.profile.d/zoxide.sh +++ b/dotfiles/system/.profile.d/zoxide.sh @@ -8,4 +8,4 @@ eval "$(zoxide init zsh)" # Alias cd to use zoxide -alias cd="z" +# alias cd="z" |
