yubiswitch icon indicating copy to clipboard operation
yubiswitch copied to clipboard

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

Open amosshapira opened this issue 5 years ago • 8 comments

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?

amosshapira avatar Sep 26 '18 04:09 amosshapira

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.

vipulsabhaya avatar Apr 21 '19 18:04 vipulsabhaya

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. :)

pallotron avatar Apr 25 '19 20:04 pallotron

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

hmstanley avatar Jul 15 '19 17:07 hmstanley

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.

francsw avatar Nov 26 '20 01:11 francsw

udevadm is a linux thing. not a MacOS thing.

pallotron avatar Sep 29 '22 07:09 pallotron

@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.

pallotron avatar Sep 29 '22 07:09 pallotron

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.

digitaljerry avatar Dec 19 '23 16:12 digitaljerry

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

pallotron avatar Dec 19 '23 16:12 pallotron