mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-15 09:54:33 +12:00
battery hack works on M1
This commit is contained in:
parent
ce51031142
commit
a9b64d62e4
|
@ -333,7 +333,8 @@ namespace Cpu {
|
|||
FILE *bat = popen("pmset -g batt", "r");
|
||||
if (bat) {
|
||||
char buf[2048];
|
||||
if (fgets(buf, sizeof(buf), bat) != NULL) {
|
||||
while (fgets(buf, sizeof(buf), bat) != NULL) {
|
||||
Logger::debug(buf);
|
||||
char *perc = strstr(buf, "%");
|
||||
if (perc) {
|
||||
has_battery = true;
|
||||
|
|
Loading…
Reference in a new issue