Rava wrote: β10 Oct 2021, 20:55
When I select a file, fzf just prints the file name.
After all, fzf is a finder...
You can do things like:
in your $HOME, then start typing some video name, then hit return, then watch it (as xdg-open relies on your system mimetypes). Pretty fast if you set a terminal tab or attach a tmux session.
Also, as I showed above, you can activate a module following the same approach.
Code: Select all
activate $(find $PORTDIR/ -iname '*.xzm' | fzf)
Or if using
nemesis, query the database to see package info then hit return, and selected package will be installed at your will. Maybe you can easily create a wrapper to build slack packages from there.
There's even a
fuzzy youtuber
Here is a
tutorial.
Regarding the color scheme (if this is what matters), this snippet (borrowed from
fzfx) may put you on track. Set your
FZF_DEFAULT_OPTS in your .bashrc and change it to suit your taste. (I don't know if the version is relevant here, but slackware seems to be in 0.17 while the Archlinux one I'm using on Nemesis is 0.27 by now.
Code: Select all
# DEFAULTS
# f1 opens with xdg-open, f2 opens with text editor, f3 copy path to console clipboard,
# f4 echoes path to stdout, alt+shift+d move file to trash.
defaultBind="\
f1:execute-silent(xdg-open {} 2>/dev/null)+cancel,\
f2:execute($editor {})+cancel,\
f3:execute-silent(xclip <<< {})+cancel,\
f4:accept,\
enter:execute(echo $searchPath/{})+abort"
defaultHeader="f1 β default, f2 β editor, f3 β clipboard, f4 β terminal, alt+shift+d β delete"
if [ "$(command -v bat)" ]; then
defaultPreview="bat --style=numbers --color=always --line-range :500 {}"
else
defaultPreview="cat {}"
fi
defaultOpts="--preview-window=right:50%:wrap"
defaultOpts="--preview-window=right:50%:wrap"
#defaultColors="
#dark,\
#bg+:#373e47,\
#bg:#2d333b,\
#spinner:#6bac00,\
#hl:#0087e9,\
#fg:#adbac7,\
#header:#009385,\
#info:#d9b600,\
#pointer:#b37eff,\
#marker:#cf2424,\
#fg+:#dddddd,\
#prompt:#d40059,\
#hl+:#ff5c00"
# Export Defaults
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --bind '$defaultBind' --header '$defaultHeader' --preview '$defaultPreview' $defaultOpts" #--colors $defaultColors
Happy ffsaaafasdzxfasafasfasdfzzzingg!!
