Accurately associate snap processes with their desktop app#654
Merged
nokyan merged 1 commit intonokyan:mainfrom Apr 2, 2026
Merged
Accurately associate snap processes with their desktop app#654nokyan merged 1 commit intonokyan:mainfrom
nokyan merged 1 commit intonokyan:mainfrom
Conversation
be80441 to
b9ca27a
Compare
Contributor
Author
|
Hopefully one day we won't have to do IPC to find about the snap desktop id, but that day is not today :( |
b9ca27a to
efe14e3
Compare
Owner
|
Hi, thanks a lot for your PR. I'll take a proper look at it tomorrow. :) |
b29c614 to
8ef0e10
Compare
Owner
|
I don't see any issues now, though I can't test the snap part on my machine because I don't use snap. Within the next few days, I'll get an Ubuntu VM running and do some further testing on that. |
8ef0e10 to
39beeca
Compare
Owner
|
Hi, I tested your changes, snaps are detected more accurately, though I'm seeing in the logs that the intended way basically never seems to work? I'm on a somewhat fresh Ubuntu 24.04 install using Flatpak's build system. |
Owner
* Do not use X-SnapInstanceName as app id, it's not appropriate; instead, use
the stripped desktop file name.
* Parse the snap process cgroup according to the snapd convention
* Use the cgroup to identify snap-name and snap-app-name (one snap may provide
multiple apps)
* Use snap-name and snap-app-name to query snapd over its REST API and get
the desktop file associated with it.
* In case of failure, fallback to the most common case:
"{snap-name}_{snap-app-name}"
Because calling the REST API is async IO, we keep track of in-flight requests
as futures and check their status at every refresh().
Closes: nokyan#599
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39beeca to
9e62463
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

X-SnapInstanceNameas app id, it's not appropriate; instead, use the stripped desktop file name.snap-nameandsnap-app-name(one snap may provide multiple apps)snap-nameandsnap-app-nameto query snapd over its REST API and get the desktop file associated with it.{snap-name}_{snap-app-name}Because calling the REST API is async IO, we keep track of in-flight requests as futures and check their status at every
refresh().Closes: #599