mirror of https://github.com/aristocratos/btop.git
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");
|
FILE *bat = popen("pmset -g batt", "r");
|
||||||
if (bat) {
|
if (bat) {
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
if (fgets(buf, sizeof(buf), bat) != NULL) {
|
while (fgets(buf, sizeof(buf), bat) != NULL) {
|
||||||
|
Logger::debug(buf);
|
||||||
char *perc = strstr(buf, "%");
|
char *perc = strstr(buf, "%");
|
||||||
if (perc) {
|
if (perc) {
|
||||||
has_battery = true;
|
has_battery = true;
|
||||||
|
|
Loading…
Reference in New Issue