FZF xbps menu
This commit is contained in:
parent
fe526293e0
commit
5a27ca1068
|
@ -0,0 +1,19 @@
|
|||
function fbps
|
||||
argparse 'h/help' 'i/install' 'r/remove' -- $argv
|
||||
or return
|
||||
|
||||
set --local -x FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=40% --preview-window=wrap --marker="*" --color=bg+:#313244,spinner:#f5e0dc,hl:#f38ba8 --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc --color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8'
|
||||
|
||||
if set -ql _flag_remove
|
||||
xbps-query -l | rg -o --pcre2 '(?<=\\w{2}\\s)[A-z-]*(?=-\\d+.*)' | fzf -q "$1" -m --preview 'xbps-query {1} | bat -p --language yaml --color=always' | xargs -ro sudo xbps-remove
|
||||
else if set -ql _flag_install
|
||||
xbps-query -Rs '*' | rg -o --pcre2 '(?<=\[-\]\s)[\w-]*(?=-\d+.*)' | fzf -q "$1" -m --preview 'xbps-query -R {1} | bat -p --language yaml --color=always' | xargs -ro sudo xbps-install
|
||||
else
|
||||
echo -e "Usage: fbps [MODE]\n"
|
||||
echo "MODE"
|
||||
echo -e " -i --install\tInstall a remote package"
|
||||
echo -e " -r --remove\tRemove an installed package"
|
||||
return 0
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue