dotfiles/home/bin/executable_linux-app-launcher

20 lines
470 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2023-11-05 09:44:45 -08:00
# https://gist.github.com/nicedreams/f8d0a6373949f6d9b9583e7e1634a1c3
2023-11-05 09:44:45 -08:00
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
2023-11-22 23:54:15 -08:00
setsid -f "${launchapp}" &> /dev/null &
2023-11-05 09:44:45 -08:00
sleep .1
fi
}
2023-11-05 09:44:45 -08:00
bmenu "$@"