Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
1.1 KiB

  1. function buku-fzf
  2. # buku -p -f 5 | awk -F '\t' 'BEGIN { OFS=FS }; { $2=substr($2, 1, 90); print }' | column -t -s (printf '\t') | fzf --multi | awk '{ print $1 }'
  3. # if test (count $argv) -ge 1 -a "$argv[1]" = "fq"
  4. # set ids (buku -t fq -f4 | awk -F '\t' 'BEGIN { OFS=FS }; { sub(/https?:\/\/(www\.)?/, "", $2); $2=substr($2, 1, 45); $3=substr($3, 1, 50); print }' | column -t -s (printf '\t') | fzf --multi --tiebreak end | awk '{ print $1 }')
  5. if test (count $argv) -eq 1
  6. # TODO: column width? #
  7. set ids (buku -t + "$argv" -f4 | awk -F '\t' 'BEGIN { OFS=FS }; { sub(/https?:\/\/(www\.)?/, "", $2); $2=substr($2, 1, 45); $3=substr($3, 1, 50); print }' | column -t -s (printf '\t') | fzf --multi --tiebreak end | awk '{ print $1 }')
  8. # echo buku -t + "$argv" -f4
  9. else
  10. set ids (buku -p -f4 | awk -F '\t' 'BEGIN { OFS=FS }; { sub(/https?:\/\/(www\.)?/, "", $2); $2=substr($2, 1, 45); $3=substr($3, 1, 50); print }' | column -t -s (printf '\t') | fzf --multi --tiebreak end | awk '{ print $1 }')
  11. end
  12. for id in $ids
  13. buku -o $id
  14. end
  15. end