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

Add an API to launch desktop entries #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

oknozor
Copy link

@oknozor oknozor commented Jun 2, 2022

Related to pop-os/launcher#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.

src/exec/graphics.rs Outdated Show resolved Hide resolved
src/exec/graphics.rs Outdated Show resolved Hide resolved
src/exec/dbus.rs Outdated Show resolved Hide resolved
src/exec/error.rs Outdated Show resolved Hide resolved
src/exec/mod.rs Outdated Show resolved Hide resolved
src/exec/mod.rs Outdated Show resolved Hide resolved
src/exec/graphics.rs Outdated Show resolved Hide resolved
@oknozor oknozor force-pushed the main branch 2 times, most recently from 60a6abf to 4919bcb Compare June 2, 2022 14:49
@oknozor
Copy link
Author

oknozor commented Jun 6, 2022

Just added desktop entry actions, let me know if anything needs to be changed.

@mmstick
Copy link
Member

mmstick commented Jun 6, 2022

Seems fine, but should we also support async zbus calls?

@oknozor
Copy link
Author

oknozor commented Jun 6, 2022

We could easily add an async api with zbus async calls and tokio::process instead of std::process. I am not sure if this would be useful though. Most of the time you just want to launch one entry and exit.

@oknozor
Copy link
Author

oknozor commented Jun 15, 2022

@mmstick is there something more I can do ?

@mmstick
Copy link
Member

mmstick commented Jun 15, 2022

Has this been integrated into the pop-launcher/pop-shell PR?

@jakeisnt
Copy link

jakeisnt commented Jan 7, 2023

Hey! Is this ready to merge yet? Would love to use it.

@jakeisnt
Copy link

jakeisnt commented May 11, 2023

@mmstick - Is this ready to go? I've been using this - it's worked well. Would love to have an official release.

@liias
Copy link

liias commented Mar 3, 2024

FWIW - I don't use this library for launching apps directly and would like such feature to live under a "feature" to avoid any extra dependency.

(Though I'm not sure if this repository is still maintained.)

@mmstick
Copy link
Member

mmstick commented Mar 3, 2024

This library is maintained. It is a dependency of the COSMIC desktop.

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

4 participants