MatthiasGrandl / Loungy

Loungy is a WIP launcher in the vein of Spotlight, Alfred, Raycast.
MIT License
1.35k stars 70 forks source link

linux: Desktop file names #18

Closed Bloeckchengrafik closed 4 months ago

Bloeckchengrafik commented 4 months ago

This PR tries to parse desktop files and show the actual names instead of the desktop file name.

Depends on #17 for obvious reasons

MatthiasGrandl commented 4 months ago

I think it makes sense to parse desktop files with something like serde_ini. You can also check Onagre for inspiration. It’s a pure linux rust based launcher and it looks very sensible what they are doing. (They also have a tiny library to get Icons, which I would be ok to include in Loungy).

I appreciate the PR! All my Linux work has to happen on a VM currently which is kinda annoying :)

Bloeckchengrafik commented 4 months ago

That sounds like a reasonable idea. I'll look into it.

Bloeckchengrafik commented 4 months ago

The onagre crate isn't split into multiple crates, so, if used as a dependency, we'd have to include everything. Or we just copy-paste the relevant file, I think the license would allow that.

Also, I think it's better to split that into a seperate PR. What do you think?

MatthiasGrandl commented 4 months ago

@Bloeckchengrafik https://github.com/oknozor/freedesktop-icons

this is what I meant. :) I am fine with it being multiple PRs.

MatthiasGrandl commented 4 months ago

Oh... there is also this, which might be even nicer to use than serde_ini https://git.sr.ht/~zethra/freedesktop_entry_parser especially since serde_ini is kinda abandoned.

MatthiasGrandl commented 4 months ago

I just pushed a refactor of platform specific code, which should allow us to share more code between Linux and MacOS. This sadly means you need to adjust this Pull Request a bit. The code should now go here: https://github.com/MatthiasGrandl/Loungy/blob/main/src/platform/linux.rs#L9

Thanks and sorry for the changes. I just want to avoid having to do a larger refactor later on :)

Bloeckchengrafik commented 4 months ago

I'll open another PR with the changes :)