csminer icon indicating copy to clipboard operation
csminer copied to clipboard

add linux option to mine only when connected to power

Open mdcarreira opened this issue 5 years ago • 10 comments

I really want to run this app every time I start my laptop, but since it has no option to mine only when connected to power, it can drain the battery really fast if you forget to turn it off while on battery. Please add an option (flag) to allow to mine only when connected to power adapter.

mdcarreira avatar Jul 23 '20 22:07 mdcarreira

Thanks, good suggestion -- will look into this. Workaround I've found on my (mac) laptop is I configure it to sleep when idle if it's not connected to power, which suspends any activity (including mining) effectively preventing the miner from running unless plugged in. Not sure if windows/linux offers similar power controls.

cryptonote-social avatar Jul 24 '20 13:07 cryptonote-social

implemented for osx in https://github.com/cryptonote-social/csminer/commit/5de524a8a8b6a4c23066cbc687f30193a76c3b0d https://github.com/cryptonote-social/csminer/commit/1ee73141baf285aec6965b6237b87caac4304aa8

cryptonote-social avatar Jul 26 '20 04:07 cryptonote-social

Yes, I also have that option checked on my macbook. The problem is that I use my macbook for playing music and, in this case, the screen will turn off but the computer won't go to sleep. I was playing music the other day and the battery went down pretty fast, and then I noticed that csminer was the culprit :)

mdcarreira avatar Jul 26 '20 11:07 mdcarreira

By the way, thanks for the fast improvement! Will you issue a new release? Will you use the releases feature of GitHub?

mdcarreira avatar Jul 26 '20 11:07 mdcarreira

Yes, this feature will go out in v0.0.8. The OSX version looks ready to go so I hope to have it up some time today. I'll adopt the releases feature in GitHub at some point, but for now the releases will continue to appear at https://cryptonote.social/tools

cryptonote-social avatar Jul 26 '20 14:07 cryptonote-social

feature now released (for osx) in v0.1.0. Leaving issue open until it's added to the win & linux versions as well.

cryptonote-social avatar Jul 27 '20 00:07 cryptonote-social

Perfect! I just tried it out on my mac and it seems to be working fine.

mdcarreira avatar Jul 28 '20 21:07 mdcarreira

this is now implemented in Windows (v 0.2.0)

cryptonote-social avatar Aug 24 '20 03:08 cryptonote-social

Pretty shure this can be implemented across platforms, since this is a configuration option form xmrig as per config.json:

"pause-on-battery": true,
"pause-on-active": false

kkarhan avatar Apr 04 '23 12:04 kkarhan

power management tends to be architecture if not OS or window-manager specific. one could look at how xmrig supports it for linux and port that over.

cryptonote-social avatar Apr 04 '23 14:04 cryptonote-social