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

LPM is toggled in settings but app is closed before authentication can happen #5

Closed
ellygaytor opened this issue Feb 8, 2023 · 3 comments

Comments

@ellygaytor
Copy link

Workflow version

2023.1

Alfred version

5.0.6

macOS version

13.1

Debugger output

[11:46:00.825] Logging Started...
[11:46:03.675] Low Power Mode[Script Filter] Queuing argument '(null)'
[11:46:03.727] Low Power Mode[Script Filter] Script with argv '(null)' finished
[11:46:03.731] Low Power Mode[Script Filter] {"items":[{"title":"Battery’s Low Power Mode is Off","subtitle":"Action to turn it off","arg":2,"icon":{"path":"images/icon_battery_off.png"}},{"title":"AC’s Low Power Mode is Off","subtitle":"Action to turn it off","arg":3,"icon":{"path":"images/icon_adapter_off.png"}}]}
[11:46:05.357] Low Power Mode[Script Filter] Processing complete
[11:46:05.359] Low Power Mode[Script Filter] Passing output '2' to Run Script
[11:46:12.307] Logging Stopped.

More details

The script does what is expected, as far as I can tell. However, at least on my system, I am asked to authenticate via password or TouchID before the changes are made, and the script closes the settings app before I can authenticate.

@vitorgalvao
Copy link
Member

Are you saying that even if you manually open the System Settings app, navigate to the Battery section, then change the dropdown, you get an authentication dialog?

Is your macOS account an admin account?

@ellygaytor
Copy link
Author

Yes, that's exactly right. My account is an admin, and is the only account on the system.
Safari 2023-02-08 at 11 56 20@2x

@vitorgalvao
Copy link
Member

First case I’ve seen of that and I’m not finding any information on it, including how to turn that off. What’s the model of your Mac?

Unfortunately, I doubt there’s anything which can be done because the authentication prompt is being caused by a GUI interaction, meaning it doesn’t know the authentication was triggered or when it was resolved.

There are two options:

  • Find out how to turn off the authentication prompt.
  • Edit the Run Script object and go near the bottom. Either delete the if (!settingsRunning) systemSettings.quit() line so System Settings isn’t auto-closed or change the delay(0.5) to a higher number (e.g. delay(3)) so it takes longer before closing (thus giving you the extra time to authenticate).

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

No branches or pull requests

2 participants