Closed sidevesh closed 3 years ago
The process name is the psutil Process name of the active X11 process id. See what Spotify is named in ps
output.
ps -aux has a bunch of entries for spotify but this looks like he main one:
swapn 6717 0.0 0.0 6912 1020 ? S Mar28 0:00 /usr/libexec/flatpak-bwrap --args 33 spotify
the flatpak-bwrap
is not spotify specific though and is what launches flatpak apps, how can we test for an app running from within flatpak ?
That's a problem then. flatpak-bwrap is deficient, and should rewrite its process information. It might be possible to upgrade the relevant bit of code in diversion.py to look like https://psutil.readthedocs.io/en/latest/#find-process-by-name but that could end up with false positives - better to fix flatpak.
Maybe adding another condition for WM_CLASS could solve this, since that is only specified by the app developer and should be unchanged across any packaging formats or direct binary. I can take a look at implementing this is the idea seems sound to you :)
I think that overloading the current condition would be the best approach here. Another good enhancement would be to match against the filename part of the process name if the process name is a file path (i.e., contains a '/').
By overloading do you mean changing the code so that if the supplied process name doesn't match current active process then then matching the supplied process name wth the WM_CLASS ?
That can be done, and in that case the process condition should be renamed to process or wm class
or something similar to clarify this,
or maybe just a info line below the process name input field would do.
Thoughts @pfps ?
Yes, an additional match against the wm class.
I don't think that there is a need for a change for the condition name, just a change to the Solaar documentation.
Raised #1133 based on our discussion here @pfps
Information
solaar --version
orgit describe --tags
if cloned from this repository):solaar 1.0.5
uname -srmo
):Linux 4.20.17-042017-generic x86_64 GNU/Linux
solaar show
:Describe the bug Is there a way to use process matching in rules for apps that are packaged with flatpak ? I am running spotify flatpak version and using Spotify, spotify com.spotify.Client for process name does not work. This may not be a limitation of Solaar but should be doable. Will close if that is the case.