1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2024-11-22 16:30:59 +02:00
dotfiles/.bin/desktop_launcher.sh

15 lines
414 B
Bash
Raw Normal View History

2018-11-12 16:48:09 +02:00
#!/bin/bash
oIFS=$IFS
IFS=:
data_dirs=($XDG_DATA_DIRS)
IFS=$oIFS
2018-11-19 17:10:32 +02:00
data_dirs+=("${HOME}/.local/share")
2018-11-12 16:48:09 +02:00
2018-11-19 17:10:32 +02:00
fzf_history="${HOME}/.desktop_launcher_history"
for folder in ${data_dirs[*]}; do find "${folder%/}/applications" -name '*.desktop' -print0; done \
| xargs -0 basename -z -s .desktop -a \
| sort -r -z \
| fzf +m --read0 --history="${fzf_history}" \
| xargs -r swaymsg -t command exec gtk-launch