Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

laixintao/mactop

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:

Installation

pip install mactop

Usage

sudo mactop

It requiressudo becausepowermetrics requiressudo, you can runmactopwithoutsudo but some metrics will be missing.

For M1 Macbook users, please run:

sudo mactop -t m1.xml

What is-t here? It's for "theme"! And you can have your own theme!

Design Your Own Mactop

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;
  • class orclasses, separated by space;
  • refresh_interval: set this will overwrite command line arguments--refresh-interval for 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.

Debug

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

Development

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp