8000 Autostart by teamcons · Pull Request #94 · elfenware/badger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Autostart #94

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

Merged
merged 16 commits into from
Jun 22, 2025
Merged

Autostart #94

merged 16 commits into from
Jun 22, 2025

Conversation

teamcons
Copy link
Contributor
@teamcons teamcons commented May 22, 2025

Fixes #87,

this is the proper one
i am struggling with git - never had to do multi branch drifting before

@dar5hak
Copy link
Collaborator
dar5hak commented May 22, 2025

Thanks again. General GitHub tip: avoid making your changes to the fork's main branch. Create a separate branch instead, like you did here. Saves a lot of trouble.

teamcons

This comment was marked as outdated.

@dar5hak
Copy link
Collaborator
dar5hak commented May 22, 2025

Okay, so how do I test this? I checked out the branch, built and installed with flatpak-builder, then opened the window normally. It started doing its thing, but didn't ask for an autostart permission. I rebooted the machine, and still nothing. I'm probably missing something? Is there something to configure? Sorry, I'm new to portals.

@teamcons
Copy link
Contributor Author

Make sure Badger is stopped
Go in elementary Autostart settings
Delete the badger entry. Not just disable. Delete it.

Build this branch
then run

flatpak run com.github.elfenware.badger --request-autostart

you will see a "Requesting autostart" in the terminal at some point
ok, wait a few seconds just in case, Ctrl+C now
Go in elementary Autostart settings

is there a badger ?

Likely, it does not ask, because we gave it permission in the past - I see in the eOS settings, the flag for autostart is set. Which is why there is no popup
Ive tried again with the toggle for background disabled. It auto-denies it.

Im not sure how we could ask for Pantheon to "forget" and ask like the first time around. But for total first time users it should show. Same in gnome-shell.

image

Alternatively we can add the permission in the manifest, so this never ever becomes a topic

@dar5hak
Copy link
Collaborator
dar5hak commented May 23, 2025

Ah okay, got it. Let me test it in the evening. 🙌

@dar5hak
Copy link
Collaborator
dar5hak commented May 23, 2025

Hmm, you're right, it didn't ask. And people will likely be confused about it stopping. Let me look up how the permission works.

@teamcons
Copy link
Contributor Author

The manifest entry to have control ootb would be

  • --talk-name=org.freedesktop.portal.Background

we would be getting flak for it for a flathub release (these people are quite rigid), and comments at best from the appcenter reviewer (we could try, though)

we could also explain in the UI that people need to add background permission (and link to it), and/or have a button to do the requesting but it could fail/get denied immediately/fail and show a dialog explaining why

also the UI is minimal, theres not really a place to put anything related to permissions/autostart (maybe divide in two tabs? Scales/Settings)

I dont have a solution. I feel like thats a big ass element for the future of the app that you need to decide.
Whatever you choose, i support it because you are cool and your hairs are soft.

@dar5hak
Copy link
Collaborator
dar5hak commented May 26, 2025

The background portal docs do specify an option to specify user-visible reason that the user can read before deciding to give permission.

I think we should just try the manifest entry. This is the exact use case the portal exists to serve. We'll deal with any concerns that arise.

@teamcons
Copy link
Contributor Author

Yeah and also the app is open source so people can tell theres nothing shady, just a lil critter

I have no clue how to test this because toggling off background permission is telling pantheon explicitly to disallow Badger and i suppose Pantheon has priority over the manifest.

I may also copy 1:1 this approach for Reminduck which im also trying to port

@dar5hak
Copy link
Collaborator
dar5hak commented May 27, 2025

Okay, I'll test this again, maybe from a separate user and then we should be good to go.

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 6, 2025

Sorry for the delay. I tested this from a fresh account on my system, but strangely, it still doesn't ask for permission to autoload. So it's not that Pantheon "remembers" things from a past life, it's just how it deals with the flag.

@teamcons
Copy link
Contributor Author
teamcons commented Jun 6, 2025

Did you revert it to before i added the permission in the manifest?
If the permission is there, theres no point im asking for it

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 7, 2025

I tried with that as well on a fresh user, but still doesn't ask. 😕 Do you know of any other way?

@teamcons
Copy link
Contributor Author
teamcons commented Jun 7, 2025

No. I dont. Theres no plumbing either because apps arent supposed to control that.

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 7, 2025

Yeah, this is gnarlier than we thought. I'll try and dig deeper on this.

@teamcons
Copy link
Contributor Author
teamcons commented Jun 7, 2025

The toggle to disable reminders is literally the first thing user see

  • The target audience, eOS, has a very easy to access setting
  • Even if the user kept the app disabled but present, without removing autostart, for whatever reason, its a 50-80mb hit, at worst.

Thats like negligible
Id just ship with permission. Badger was initially thought out to install without asking either.

@teamcons
Copy link
Contributor Author
teamcons commented Jun 7, 2025

We could also have the toggle be the one setting/removing thr flag
As in if the user enable it, its to have reminders, so may keep it accross reboots
If the user disable it, then the user doesnt want reminders, so just remove the flag

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 7, 2025

Running in the background and consuming a small amount of memory by keeping the flag on isn't an issue.

The issue is that it doesn't actually autostart. So across sessions, the user needs to launch it manually despite the flag being on and the item showing up in Startup settings. That's what I'm trying to wrap my head around.

@teamcons
Copy link
Contributor Author
teamcons commented Jun 7, 2025

It doesn't ? Shit i thought the issue was the asking part. I thought the ability to run without windows still worked ??
Cant check or test the code right now

Else we could just do it the old way and add permission to . config/autostart...

My god why is this so complicated ?? Its a very small app with like five tog 67E6 gles!

@teamcons
Copy link
Contributor Author
teamcons commented Jun 7, 2025

Headless mode still works if manually started yes ?

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 7, 2025

It does, yes. I was also considering going back to the old autostart script. This looks like one of those rare cases where the hack works better than the standards. 😄

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 16, 2025

I tried the old way of installing an autostart .desktop file, but now flatpak creates its own sandboxed directories so even that doesn't work. 🫠 😭

@teamcons
Copy link
Contributor Author

Did you put in permission for that folder

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 17, 2025

Oh. My bad. Another reason to fix my currently multi-planetary sleep cycle. 🙃

@teamcons
Copy link
Contributor Author

gkhtrrthbktr take care of yourself man

Let us know if we should do this or anything (though Stellas frustrated about this thing)

@dar5hak
Copy link
Collaborator
dar5hak commented Jun 18, 2025

@teamcons Thank you for the support. You've been amazingly patient on this one.

I am planning to spend some time on Sunday to close this for good, but do share any guidance/pointers/gotchas. You know a lot more than me about how this stuff works in 2025.

Copy link
Collaborator
@dar5hak dar5hak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a long-haired English dude said in the 16th century, much ado about nothing.

@dar5hak dar5hak merged commit cc0f9c9 into elfenware:main Jun 22, 2025
2 checks passed
@teamcons
Copy link
Contributor Author

What

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.

Doesn't autostart on login
2 participants
0