Update fzf scripts

master
Hektor Misplon 2022-10-25 21:29:26 +02:00
parent 23f6d6f1b4
commit cac2e1a74e
3 changed files with 8 additions and 6 deletions

View File

@ -4,6 +4,6 @@ options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0)
notify-send --app-name= -t 3000 "$(trans $selected -b "$(dmenu -p $selected &)" \
notify-send --app-name= -t 3000 "$(trans "$selected" -b "$(dmenu -p "$selected" &)" \
| tr -d '\n' \
| xclip -sel clip -f)"

View File

@ -4,7 +4,8 @@
# Generate menu of book filenames and save paths
# Preview window contains metadata
selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1 --preview 'pdfinfo {}' --preview-window=right:70%:wrap)"
# selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1 --preview 'pdfinfo {}' --preview-window=right:70%:wrap)"
selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)"
# Open and redirect output to /dev/null
zathura "$selected" 2> /dev/null &
zathura "$selected" --fork

View File

@ -11,11 +11,12 @@ update() {
font_list=$(fc-list -f "%{fullname}\n")
echo "$font_list" | while read -r line ; do
echo "$font_list" | while read line ; do
first="$(echo "$line" | cut -d',' -f1)"
last="$(echo "$line" | cut -d',' -f2)"
if "$(contains_dash "$first")"; then
if $(contains_dash "$first"); then
echo "$last" >> "$fn"
else
echo "$first" >> "$fn"
@ -25,5 +26,5 @@ update() {
case "$1" in
--update) update;;
*) sort "$fn" | uniq | awk 'NF' | fzf;;
*) cat "$fn" | sort | uniq | awk 'NF' | fzf;;
esac