diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-21 05:06:54 -0800 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-21 05:06:54 -0800 |
| commit | aa43e4e1c78ed92e45c4d7f8cc83a8bb558f43e7 (patch) | |
| tree | 4267b184ec8dbd9fbde8f3a095d27361449c6a6b /dotfiles/system/.profile.d/fzf.sh | |
| parent | 7a0a806df05d573cf7969c9a2d80a1a49881d95a (diff) | |
session: dotfiles sync and GPG/Emacs auth debugging
Synced various dotfile configs (calibre, audacious, profile.d, xinitrc).
Diagnosed and fixed Emacs/GPG auth issue by disabling systemd emacs.service
which lacked DISPLAY environment for pinentry-dmenu.
Diffstat (limited to 'dotfiles/system/.profile.d/fzf.sh')
| -rw-r--r-- | dotfiles/system/.profile.d/fzf.sh | 19 |
1 files changed, 16 insertions, 3 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 } |
