mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
26 lines
1.3 KiB
Bash
26 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
||
#⠀ ⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||
#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||
#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀
|
||
#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT)
|
||
#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles
|
||
#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us
|
||
#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀
|
||
#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀
|
||
# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀
|
||
#
|
||
# Launch applications with fzf.
|
||
|
||
desktop_file() {
|
||
find /usr/share/applications -name "*.desktop" 2>/dev/null \
|
||
&& find /usr/local/share/applications -name "*.desktop" 2>/dev/null \
|
||
&& find "$HOME/.local/share/applications" -name "*.desktop" 2>/dev/null \
|
||
&& find /var/lib/flatpak/exports/share/applications -name "*.desktop" 2>/dev/null \
|
||
&& find "$HOME/.local/share/flatpak/exports/share/applications" -name "*.desktop" 2>/dev/null
|
||
}
|
||
|
||
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
|