freedesktop-desktop-entry
freedesktop-desktop-entry copied to clipboard
Add an API to launch desktop entries
Related to https://github.com/pop-os/launcher/pull/119
This PR add a a method to launch desktop entries either via dbus or shell commands.
When launching an entry with the prefer_non_default_gpu
option, the discrete gpu should be used either by passing the corresponding environment variables to the sub shell or via dbus.
I am not 100% confident regarding the gpu implementation since I don't have every hybrid graphics laptop available (only AMD discrete and integrated gpus), feedback would be appreciated here.
There are fake desktop entries launching glxgears -info
in the ignored tests, this should be enough to test the expected gpu is used. (see https://github.com/oknozor/freedesktop-desktop-entry/blob/33f2d16b731ed80258959b2bd859fc3056d52441/src/exec/mod.rs#L252)
For the implementation to be complete we would need a launch_action
method. I'll implement this after this PR has been reviewed.