joehillen / paruz

A fzf terminal UI for paru or pacman
The Unlicense
79 stars 3 forks source link

Just a different way (Not an Issue) #10

Open HeCodes2Much opened 1 year ago

HeCodes2Much commented 1 year ago

just a different example of how i do this

  cmd=$(pacman -Slq | fzf --prompt 'pacman> ' \
    --header 'Install packages. CTRL+[P/Y/R/I/Q] (Pacman/Yay/Paru/Installed/Quit)' \
    --bind 'ctrl-p:change-prompt(pacman> )+reload(pacman -Slq)' \
    --bind 'ctrl-y:change-prompt(yay> )+reload(yay -Slq)' \
    --bind 'ctrl-r:change-prompt(paru> )+reload(paru -Slq)' \
    --bind 'ctrl-i:change-prompt(inst> )+reload(yay -Qq)' \
    --multi --height=80% --preview 'sleep 2; yay -Si {1}' \
    --preview-window right) #| xargs -ro pacman -S
  cmd=${cmd//$'\n'/ }       # newline -> space
  if [ -n "$cmd" ]; then
    yay -S "$cmd"
  fi
  exit

image