Battery + System Stats widgets development thread

CPU (due to multicore not quite straight forward):
ncpu=$(sysctl -n hw.logicalcpu)
total=$(ps -Ao %cpu= | paste -sd+ - | bc)
usage=$(echo "scale = 2; $total / $ncpu" | bc)
printf "%0.1f%%\n" "$usage"

Total Memory: sysctl hw.memsize
Used: top -l 1 -s 0 | grep PhysMem

1 Like

Got things looking not totally broken!

Cleaned up a bit more!

The battery information could also be retrieved using Objective-C methods.

@GoldenChaos - could you make it so that clicking the memory button will clean the memory? Just like 3rd party apps can?

I don't think those "free up memory" tools are doing something I can invoke with a simple terminal command - but I can look into it!

Thanks for responding! I appreciate it!

Free up memory tools just fill up the memory until the system cleans it. There is no use in them (just placebo). The system will automatically free up memory if necessary.

2 Likes

ahhh... thanks for informing me!

Also, @Andreas_Hegenburg, could you check my bug report? Sadly no one has actually responded to my bug report :frowning:

To add to the responses above. The following available in the link below:

  • Battery Percent Left
  • Battery Time Left
  • Battery Temperature
  • CPU Percentage
  • Memory Free/Inactive/Active/etc.
  • Network Download & Upload Throughput
1 Like

Good find. I added battery temperature information to thread I linked in here earlier.

It's coming along! Icons are just placeholder while I figure out the optimal layout...

That's weird. Are you getting the negative download throughput naturally?

Yep. Was wondering about that...

Hi ! Thank you for your great work!

  1. I unchecked "Show Percentage" and "Remaining Time" But it still shows remaining time.

is there any way to fix ?
I just bought this app yesterday !

1 Like

That option only affects the menu bar widget - the long-press stats group doesn't have any configurable settings!

Hi everyone,

does anyone know if it's possible to have the battery icon on top and the time remaining underneath? Somethine like this:
Touch Bar Shot 2020-05-29 at 12.30.21

Very nice development here!
My MacBook just hard-restarted, I think because it got too hot (was on a pillow), so I was wondering if there was any way to display the CPU (or other temperature) on the Touchbar.

It sounds like this is not simple to do, and not included or planned to be added to this neat widget.
What do you think?

Hi there,

I'm trying to do the same thing but only with the icon and the percentage underneath it.
I can't for the life go me get it to work!

@GoldenChaos is it even possible?
BTW thanks for your amazing work! Love it !