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

Open at startup in the background #137

Open
shoudeyunkaijianyueming opened this issue Apr 15, 2023 · 10 comments
Open

Open at startup in the background #137

shoudeyunkaijianyueming opened this issue Apr 15, 2023 · 10 comments
Assignees

Comments

@shoudeyunkaijianyueming

Can it be turned on and self-starting, and the window is closed directly after opening, there is no sign, but it is turned on and self-starting

ps: At present, it is turned on and self-starting. I need to close the window after turning it on. Although it is only a click, it will affect the experience very much, thank you!

@terreng
Copy link
Owner

terreng commented Apr 15, 2023

Are you using Windows or macOS? Have you changed your setting so that the program launches when you turn in your computer?

@shoudeyunkaijianyueming
Copy link
Author

I am a mac, and this is how I use it, but after setting it like this, a window will appear every time I turn it on.

image

@shoudeyunkaijianyueming
Copy link
Author

image

It looks like this when booting, and I don't want this window to appear, it's silent in the background

@terreng terreng changed the title Can it be turned on and self-starting, and the window is closed directly after opening Open at startup in the background Apr 16, 2023
@terreng
Copy link
Owner

terreng commented Apr 16, 2023

Thanks for the suggestion. It looks like this might take more than just a little work to do, so it might not happen for awhile.

Related:
https://www.github.com/Teamwork/node-auto-launch/issues/93
https://www.github.com/electron/electron/issues/7312

@shoudeyunkaijianyueming
Copy link
Author

It's okay, I can wait, looking forward to your new update.

@lucianoshl
Copy link

+1

1 similar comment
@rishit537
Copy link

+1

@terreng
Copy link
Owner

terreng commented Oct 22, 2023

For macOS we can use the openAsHidden flag of app.setLoginItemSettings, but it only works on macOS non-MAS builds. However, we should be able to pass a custom argument to detect opening at startup and avoid creating the window.

See https://www.electronjs.org/docs/latest/api/app#appsetloginitemsettingssettings-macos-windows

@terreng terreng self-assigned this Oct 22, 2023
@rishit537
Copy link

For macOS we can use the openAsHidden flag of app.setLoginItemSettings, but it only works on macOS non-MAS builds. However, we should be able to pass a custom argument to detect opening at startup and avoid creating the window.

See https://www.electronjs.org/docs/latest/api/app#appsetloginitemsettingssettings-macos-windows

Eagerly waiting for a solution in windows.

@ethanaobrien
Copy link
Collaborator

ethanaobrien commented Oct 22, 2023

For windows, you can create a shortcut to the application at C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\. Windows supports defining launch arguments with shortcuts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants