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

[Feature Request] add an isEnabled method to the Backgroud portal #1072

Open
Merrit opened this issue Aug 14, 2023 · 5 comments
Open

[Feature Request] add an isEnabled method to the Backgroud portal #1072

Merrit opened this issue Aug 14, 2023 · 5 comments
Labels
need more info needs discussion Needs discussion on how to implement or fix the corresponding task new api This requires adding API to an existing portal portal: background Background portal and background monitoring

Comments

@Merrit
Copy link

Merrit commented Aug 14, 2023

The current implementation gives no way to check if the application is set to autostart or not.

@GeorgesStavracas
Copy link
Member

Could you please describe your use case, and what exactly are you trying to accomplish that would require this? I'm not necessarily opposed to this suggestion, but I want to have a clearer picture and evaluate other options if they exist.

@GeorgesStavracas GeorgesStavracas added new api This requires adding API to an existing portal need more info needs discussion Needs discussion on how to implement or fix the corresponding task portal: background Background portal and background monitoring labels Oct 3, 2023
@Merrit
Copy link
Author

Merrit commented Oct 3, 2023

Sure:

  • Application is navigated to settings
  • We want to have a checkbox/switch to say if the application will autostart or not
  • With no way to query the host system if this is enabled, we simply rely on a boolean we set to local preferences when we initially set up autostart.
  • If the actual setting on the host has changed, our switch will still say "Yes, the app will autostart" when in fact this is not the case. In contrast, if we can query the host at startup "Am I set to autostart?" that can be the boolean value for the switch.

I had essentially this exact issue, and when a bug report was filed and I investigated I had 2 options:

  1. Tell people to flip the switch off/on
  2. Check the local preference, and set the host autostart to true on every app start if need be. To be fair this works, but being able to query it seems more obvious and somehow better than constantly re-setting it. 🤷‍♀️

@Mikenux
Copy link

Mikenux commented Nov 28, 2023

It is clearly necessary to revise what is wanted for autostart in relation to background activity.

@Merrit: Could you tell why your app needs to be autostarted? (chat app? restart a task/activity? launch a task at each user session start? other...)

@Merrit
Copy link
Author

Merrit commented Nov 29, 2023

Sure, my app supports built-in global hotkeys so actions can be invoked quickly and easily. Most users that make use of such hotkeys would want them to be registered and available without having to first launch the app, so it supports an autostart (in the background) feature.

To be specific to my app: Nyrna lets users suspend/resume games and applications. So the idea is they configure it to start automatically in the background, with a hotkey registered. Now at any time they can suspend/resume various applications at the push of a button.

I initially had this set up to support CLI flags, so one could create a custom shortcut from system settings to invoke - however there were persistent requests for a built-in hotkey solution, which requires the app to be running.

@Mikenux
Copy link

Mikenux commented Nov 30, 2023

@Merrit:

Thanks!

Personally, I'm for asking the user to grant permission to autostart apps instead of having that in the apps. However, what is needed is a way to make apps start without a visible window without depending on the apps to do so. This was the missing piece mentioned when discussing background apps on GNOME.

For your app, you might want to look at what it is missing, since the goal is to have the apps fully sandboxed. You can see if there are already open issues regarding what is missing and, if issues do not exist, request the creation of new portals or the extension of existing ones (maybe now in Discussions). Better to do it early than too late 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info needs discussion Needs discussion on how to implement or fix the corresponding task new api This requires adding API to an existing portal portal: background Background portal and background monitoring
Projects
Status: Triaged
Development

No branches or pull requests

3 participants