# vim: ft=sh pf() { # project finder root_dir="$HOME/docs/src" selected_dir=$(find "$root_dir" -maxdepth 1 -type d | sed "s:$root_dir::;s:/::;/^$/ d" | BEMENU_BACKEND=curses bemenu -p "Choose directory") && cd "$root_dir"/"$selected_dir" || return } xb() { # function for handling xbps in a nicer way case $1 in install | i) sudo xbps-install "${@:2}" ;; remove | r) sudo xbps-remove -R "${@:2}" ;; query | q) xbps-query "${@:2}" ;; search | s) xbps-query -Rs "${@:2}" ;; upgrade | u) sudo xbps-install -Su ;; locate | l) xlocate "${@:2}" ;; *) printf "Usage:\n" printf "xb i: xbps-install\n" printf "xb r: xbps-remove -R\n" printf "xb q: xbps-query\n" printf "xb s: xbps-query -Rs\n" printf "xb u: xbps-install -Su\n" printf "xb l: xlocate\n" ;; esac }