I am trying to get a significant energy consuming app list as it shows in the battery icon in MacBook programmatically.
![enter image description here][1]
Like Below... [1]: https://i.stack.imgur.com/bapoI.png
Any help would be appreciated.
I tried to use the following top command in a code but it's not working.
top -stats -l 1 -O pid,command,cpu,idlew,power -o power -d