cryptonote-social / csminer

csminer Monero miner from https://cryptonote.social/
GNU General Public License v3.0
63 stars 26 forks source link

add linux option to mine only when connected to power #2

Open mdcarreira opened 4 years ago

mdcarreira commented 4 years ago

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.

cryptonote-social commented 4 years ago

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 commented 4 years ago

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

mdcarreira commented 4 years ago

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 commented 4 years ago

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

cryptonote-social commented 4 years ago

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 commented 4 years ago

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

mdcarreira commented 4 years ago

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

cryptonote-social commented 4 years ago

this is now implemented in Windows (v 0.2.0)

kkarhan commented 1 year ago

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
cryptonote-social commented 1 year ago

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.