- Notifications
You must be signed in to change notification settings - Fork1
License
laixintao/mactop
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Mactop is a tool like htop, but you can decide the data you want and decide thelayout. It is more like a Grafana for your macbook, but in terminal.
It looks like this:
pip install mactop
sudo mactopIt requiressudo becausepowermetrics requiressudo, you can runmactopwithoutsudo but some metrics will be missing.
For M1 Macbook users, please run:
sudo mactop -t m1.xmlWhat is-t here? It's for "theme"! And you can have your own theme!
We use HTML + CSS style to setup the layout.
You can useid orclass to select the element, like this:
<Mactop><layout><Horizontalid="row-1"><SensorsPanel></SensorsPanel></Horizontal></layout><style>#row-1 {color: red; }</style></Mactop>
Save your content to a file, for example,my-theme.xml, then runmactop withmactop -t my-theme.xml.
Components do not support inline-css, but you can set attributes on components.
Common attributes that every components support:
id;classorclasses, separated by space;refresh_interval: set this will overwrite command line arguments--refresh-intervalfor that component.
For component's supported attributes and component's name, please refer tomactop/panels/__init__.py and check the source code. Please bare with me, itis messy for now, I am working on documentations. If you have any questions,feel free to open an issue.
For examples of layouts, you can refermactop/themes/ directory.
If you made some beautiful layout, please send it to me! By open a PR or issue,I can merge it into this repo, thanks.
Mactop comes with verbose log support.
-v means enableinfo log, and morev means more logs, max-vvv.
mactop -vvv -l mactop.log
Then you can open another terminaltail -f mactop.log to see the logs.
Mactop usepowermetrics to get metrics from your mactop,powermetrics isdifferent on different Macbooks. If you met some issue, better submit apowermetrics sample in the issue, thanks.
Use this command (add--debug), Mactop will write json formatted powermetricsfile on your current$(PWD)/debug_json. (If you decide to paste it, only onesample (one file) is enough).
$ mactop -vvv -l mactop.log --debug$ ls debug_jsonmactop_debug_20231206_16:34:28.json mactop_debug_20231206_16:41:55.json mactop_debug_20231206_16:46:21.jsonmactop_debug_20231206_16:34:29.json mactop_debug_20231206_16:44:46.json
This project usepoetry to manage dependencies.
Clone this project and make sure you have poetry.
pip install poetrygit clone git@github.com:laixintao/mactop.git
Then install dependencies:
poetry install
You can then make changes, and test withpoetry run mactop.
About
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
