mirror of
https://github.com/gotbletu/shownotes
synced 2024-11-10 19:10:36 +00:00
19 lines
875 B
Bash
Executable File
19 lines
875 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry)
|
|
# https://www.youtube.com/user/gotbletu
|
|
# DESC: launch app(s) with fzf like dmenu/rofi
|
|
# DEPEND: fzf sed coreutils findutils xdg-utils util-linux
|
|
|
|
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 xdg-open "$line".desktop ; done
|