dotfiles/home/bin/executable_linux-app-launcher

20 lines
470 B
Bash

#!/usr/bin/env bash
# https://gist.github.com/nicedreams/f8d0a6373949f6d9b9583e7e1634a1c3
bmenu() {
launchapp=$(IFS=':'; \
for p in ${PATH}; \
do find -L "${p}" -type f -executable -print 2> /dev/null; done \
| fzf --header="Select application to launch from PATH:" \
--multi=0 \
--exact \
--height="50%" \
--preview-window="down:wrap:3")
if [[ "${launchapp}" ]]; then
setsid -f "${launchapp}" &> /dev/null &
sleep .1
fi
}
bmenu "$@"