Cloudef / bemenu

Dynamic menu library and client program inspired by dmenu
GNU General Public License v3.0
1.23k stars 95 forks source link

Support for desktop files #62

Closed MayeulC closed 4 years ago

MayeulC commented 5 years ago

Some applications, such as the ones provided trough flatpak, typically only come with .desktop files as a way to be launched.

I am not entirely sure how to handle this (if you look for an app and there are two versions: one with a desktop file and one without, what should you display?), but displaying them at the end would be a start.

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

$XDG_DATA_DIRS is the $PATH equivalent. dex can be used to launch .desktop files.

6A61736F6E206E61646572 commented 5 years ago

Sorry if I've misunderstood, but can you not use something like j4-dmenu-desktop to achieve this? e.g. j4-dmenu-desktop --dmenu='bemenu -i' --term='termite'

Earnestly commented 5 years ago

I imagine this kind of thing is well out of scope as bemenu-run only really exists as a demonstration of the library.

Cloudef commented 5 years ago

It could be possible to add this into bemenu-run as well, but I don't personally use the .desktop files at all.

MayeulC commented 5 years ago

Well, it turned out that flatpak provides executables in the form of com.example.mypackage in /var/lib/flatpak/exports/bin/, so that has become a lesser issue for me. I don't know whether this is in the scope of bemenu-run at all. I wasn't aware of solutions like j4-dmenu.

escondida commented 5 years ago

It seems like the solution really would be to simply add that flatpak bindir to $PATH--after all, oddball bindirs are the whole raison d'être for $PATH!

concatime commented 4 years ago

I know this is a closed issue, but I will try. How about running a command if bemenu finds nothing? For example, if I type vscode and bemenu offers me an empty list, hitting enter will run e.g. gtk-launch vscode? This way, no need to manually parse desktop files, it is done by gtk-launch.

Cloudef commented 4 years ago

in that case bemenu-run would try to execute vscode, regardless it being in path or not. For such specific use case, either do your own menu with bemenu, or do wrapper scripts and append them to your PATH. It's also possible to type gtk-launch vscode in the bemenu-run and hit enter.