Open dzg opened 1 year ago
one possible workaround is to use applescript and accept the GUI sudo prompt.
pmset
:osascript -e 'do shell script "/usr/bin/pmset -a disablesleep 1" with administrator privileges'
IF you do not want any prompts at all, then you can allow passwordless sudo on a specific binary.
# 1. Type in terminal: sudo visudo
# 2. Append the following line at the end of the file:
your_username_here ALL = NOPASSWD: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
None of the solutions above are nice; the cleanest way to work around this would be running a privileged helper in a separate process, but that's an entire different discussion.
Won't even mention setting suid
on the binary as that is in the /System folder and will require disabling system protection
I want to get BSSID of currently connected WiFi AP, using
airport -I
but it requiressudo
:sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport -I | grep BSSID
But how do run as admin via xbar?
Or is there a non-sudo way to get this?
Thanks