pallotron / yubiswitch

OSX status bar application to enable/disable Yubikey Nano
Other
872 stars 65 forks source link

Is there a way to turn off Yubikey to conserve battery? #81

Open amosshapira opened 5 years ago

amosshapira commented 5 years ago

The tool worked great for me for a few months but I got tired of the Yubikey Nano draining my laptop's battery. I tried turning off the "Enable Yubikey when system locks/sleeps" but it didn't help.

Once I stopped relying on Yubiswitch and instead just pull out the Yubikey when I don't need it (I usually need it about 3 times in the morning and then I'm set for most of the day), my laptop's battery started draining much slower.

Is there anything to be done about this?

vipulsabhaya commented 5 years ago

My macbook loses about 30% every night while sleeping, due to the Yubikey. Would love to know if there is a way to shut-off yubikey when laptop sleeps.

pallotron commented 5 years ago

Is there anything to be done about this?

I don't know. I haven't done research about it. I don't have time to dedicate to this project unfortunately. Feel free to investigate a solution and send a PR. :)

hmstanley commented 5 years ago

sudo pmset -a hibernatemode 25 sudo pmset -a standbydelay 15

I've done this to switch to hibernate mode with long sleeps. I've seen no functionality changes to the Mac, and the key doesn't draw power

francsw commented 3 years ago

I noticed that some applications, in my case Passwordsafe, resets the Yubikey constantly in the lockscreen. You can monitor it with udevadm monitor --udev That might be what's draining you battery.

pallotron commented 1 year ago

udevadm is a linux thing. not a MacOS thing.

pallotron commented 1 year ago

@hmstanley feel free to send a PR to add those pmset commands in the README.md file in this repo if you think they solved the battery drain issue.

digitaljerry commented 8 months ago

Any updates on this one? the pm commands are not really a viable solution since that will make your MacBook hibernate a lot. And then you have to wait for quite some time to wake it up in a normal open-laptop scenario.

Was super excited to stumble upon this project, but if you're still seeing battery drains it's not what I was looking for. Ideally locking Yubikey would completely cut of power to that usb port so it's totally inactive.

pallotron commented 8 months ago

No update and no one has time to work on this. Sorry. Feel free to investigate and propose patches, it will be greatly appreciated.