Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add path guesses for desktop entry daemon entries #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ryanabx
Copy link
Contributor

@ryanabx ryanabx commented Apr 27, 2024

Desktop Entry Daemon is a daemon that allows you to register desktop entries and icons at runtime.

There are 3 lifetimes a client can choose to use:

  • Process - Desktop entries and icons will be cleared when the calling process exits
  • Session - Desktop entries and icons will be cleared when the session is restarted OR when the daemon restarts
  • Persistent - Desktop entries and icons are persistent across reboots and won't be deleted unless explicitly called to do so.

The directories for these lifetimes are:

  • Process - /run/user/$UID/desktop-entry-daemon/process/
  • Session - /run/user/$UID/desktop-entry-daemon/session/
  • Persistent - $HOME/.cache/desktop-entry-daemon/

This PR allows for the PathSource::guess_from() function to identify paths from desktop-entry-daemon.

[Desktop Entry Daemon](https://github.com/ryanabx/desktop-entry-daemon) is a daemon that allows you to register desktop entries and icons at runtime.

There are 3 lifetimes a client can choose to use:
* Process - Desktop entries and icons will be cleared when the calling process exits
* Session - Desktop entries and icons will be cleared when the session is restarted OR when the daemon restarts
* Persistent - Desktop entries and icons are persistent across reboots and won't be deleted unless explicitly called to do so.

The directories for these lifetimes are:
* Process - `/run/user/$UID/desktop-entry-daemon/process/`
* Session - `/run/user/$UID/desktop-entry-daemon/session/`
* Persistent - `$HOME/.cache/desktop-entry-daemon/`

This PR allows for the `PathSource::guess_from()` function to identify paths from desktop-entry-daemon.
@wiiznokes
Copy link
Contributor

Why not use the default paths in the daemon?

@ryanabx
Copy link
Contributor Author

ryanabx commented Jun 1, 2024

Why not use the default paths in the daemon?

Same reason flatpak doesn't - because it needs to be sure which desktop entries belong to the daemon

Think about it - you don't want the daemon accidentally deleting your permanent entries thinking they're temporary, and vice versa, you don't want it not cleaning up temporary entries because they're in a permanent directory

@wiiznokes
Copy link
Contributor

I see, i was wondering because chrome web apps use ~/.local/share/applications/ by default

@ryanabx
Copy link
Contributor Author

ryanabx commented Jun 1, 2024

I see, i was wondering because chrome web apps use ~/.local/share/applications/ by default

Yeah, an alternative would be to save a list of managed apps from the application, which works fine, but in the event that the application quits unexpectedly or something gets messed up, it's better to know that everything there is free to delete, as it's intended to be temporary. Also removes the worry that an app will have the same ID as one that's supposed to be permanent and it gets overwritten by a temporary entry.

@wiiznokes
Copy link
Contributor

Maybe you could store them in a folder, ei ~/.local/share/applications/ded/, but i don't know if it works. You will support more DE this way

@ryanabx
Copy link
Contributor Author

ryanabx commented Jun 1, 2024

Maybe you could store them in a folder, ei ~/.local/share/applications/ded/, but i don't know if it works. You will support more DE this way

not sure if that's how the spec works, I could be not aware though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants