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 Launch at Login setting for macOS and Windows #774

Merged

Conversation

whitecrownclown
Copy link
Contributor

@whitecrownclown whitecrownclown commented Feb 12, 2019

@sindresorhus
Fixes #773

Hello!
I've added the following :

  • Launch at login menu item
  • Launch as hidden menu item (disabled if launch at login is false)
  • Tested on macOS 10.14.3

Feedback is welcome, thanks!

@sindresorhus
Copy link
Owner

You shouldn’t store the states in the config store. Just fetch the actual states from the getLogin... method when needed. That way the settings don’t get out of sync.

source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

  • Launch as hidden menu item (disabled if launch at login is false)

I don't see the point of having a setting for this. We should just launch hidden.

source/menu.ts Outdated Show resolved Hide resolved
@whitecrownclown
Copy link
Contributor Author

@sindresorhus I've updated the PR again.

  • Added the ts definition from electron
  • Removed Launch as Hidden; defaults to the same value as Launch at Login

source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
@whitecrownclown
Copy link
Contributor Author

@sindresorhus Updated again, however i'm unsure what you mean by this:

And openAsHidden: item.checked needs to be updated.

Do you mean to set it to true always? It is being updated with the same value as Launch at Login. I've noticed if Launch at Login is false it will not set Launch as Hidden as true, but false as well.

@sindresorhus
Copy link
Owner

Do you mean to set it to true always?

Yes, setting it to true when openAtLogin: false should have no effect, so might as well make it simpler.

@sindresorhus sindresorhus changed the title [Feature] Launch at login Add Launch at Login setting for macOS and Windows Feb 20, 2019
@sindresorhus sindresorhus merged commit a43e6b5 into sindresorhus:master Feb 23, 2019
@sindresorhus
Copy link
Owner

Thanks :)

@blargle-ragequit
Copy link

Why is this not on Linux?

@CvX
Copy link
Collaborator

CvX commented Jul 5, 2019

@blargle-ragequit Because the Electron API doesn’t support it: https://electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows

Here’s an open issue at the Electron repo: electron/electron#15198

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.

Add "Launch at Login" menu item
4 participants