notes: fix script, use pkgs instead of PATH

This commit is contained in:
teutat3s 2024-08-27 10:42:32 +02:00
parent 313b1faba4
commit 0e5a3fa29a
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -1,19 +1,19 @@
self: with self; '' self: with self; ''
# #
# ack recursively through notes # rg recursively through notes
# #
# uses ack: https://beyondgrep.com # uses ripgrep: https://github.com/BurntSushi/ripgrep
NOTESDIR=~/pub.solar-nc/Notes NOTESDIR=~/pub.solar-nc/Notes
ACK_PREFIX="ack --files-with-matches" ACK_PREFIX="${rg}/bin/rg --files-with-matches"
cd $NOTESDIR || exit cd $NOTESDIR || exit
file="$( file="$(
FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \ FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \
fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \ ${fzf}/bin/fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \
--phony -q "$1" \ --phony -q "$1" \
--bind "change:reload:$ACK_PREFIX {q}" \ --bind "change:reload:$ACK_PREFIX {q}" \
--preview-window="70%:wrap" --preview-window="70%:wrap"
)" && )" &&
echo "opening $file" && echo "opening $file" &&
bat --theme=TwoDark "$file" ${bat}/bin/bat --theme=TwoDark "$file"
'' ''