jacklandrin / OnlySwitch

⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
https://jacklandrin.github.io/macos%20app/2021/12/01/onlyswitch.html
MIT License
3.84k stars 185 forks source link

Clamshell without user password #96

Open rabbly opened 10 months ago

rabbly commented 10 months ago

Challenge Currently the Clamshell Evolution script requires you to enter your password every time. My password requirements are extremely long so this is a challenge.

Feature request Remove the password requirements

Workaround I have found a workaround by editing the sudoers file for the pmset command. That is not very user friendly though. For this workaround I did the following;

  1. Follow the instructions here to add pmset to the sudoers file your_short_username ALL=NOPASSWD: /usr/bin/pmset
  2. Edit the Clamsell Evolution script to remove the "as administrator" setting do shell script "sudo pmset -a disablesleep 1"

Other solutions OneSwitch has a solution for this and seems to be able to handle it

jacklandrin commented 10 months ago

You also can edit Clamshell commands to add your password like:

do shell script "sudo pmset -a disablesleep 1" with prompt "OnlySwitch" with administrator privileges password "xxxxx"

It wouldn't ask for the password every time.

rabbly commented 10 months ago

The most concerning thing about that is having my password randomly stored in plain text somewhere, but good to be aware of as an option.

jacklandrin commented 10 months ago

An alternative way is like OneSwitch, which lets users install a help tool to store account passwords to keychain. It would be safer than in plain.

rabbly commented 10 months ago

Is that something I can do, or requires a change to OnlySwitch?

jacklandrin commented 10 months ago

I will investigate how to implement it and add it on my side.