dotfiles/home/bin/executable_linux-app-launcher

27 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2023-07-06 09:51:19 -07:00
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀
#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT)
#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles
#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us
#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀
#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀
2023-07-06 09:51:19 -07:00
#⠀⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀
#
# Launch applications with fzf.
desktop_file() {
2023-07-06 09:51:19 -07:00
find /usr/share/applications -name "*.desktop"
find /usr/local/share/applications -name "*.desktop"
find "$HOME/.local/share/applications" -name "*.desktop"
find /var/lib/flatpak/exports/share/applications -name "*.desktop"
find "$HOME/.local/share/flatpak/exports/share/applications" -name "*.desktop"
2023-07-11 21:17:48 -07:00
find /run/current-system/sw/share/applications -name "*.desktop"
}
selected="$(desktop_file | sed 's/.desktop//g' | sort | fzf -e -i -m --reverse --delimiter / --with-nth -1)"
[ -z "$selected" ] && exit
cd || return
echo "$selected" | while read -r line ; do setsid gio launch "$line".desktop ; done