mactop


Namemactop JSON
Version 0.1.11 PyPI version JSON
download
home_page
SummaryHtop for macbook.
upload_time2023-12-06 09:11:32
maintainer
docs_urlNone
authorlaixintao
requires_python>=3.10,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mactop

Mactop is a tool like htop, but you can decide the data you want and decide the
layout. It is more like a Grafana for your macbook, but in terminal.

It looks like this:

![](./assets/mactop.png)

## Installation

```shell
pip install mactop
```

## Usage

```
sudo mactop
```

It requires `sudo` because `powermetrics` requires `sudo`, you can run `mactop`
without `sudo` 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 use `id` or `class` to select the element, like this:

```html
<Mactop>
  <layout>
    <Horizontal id="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 run `mactop` with
`mactop -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` or `classes`, 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 to
`mactop/panels/__init__.py` and check the source code. Please bare with me, it
is 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 refer `mactop/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 enable `info` log, and more `v` means more logs, max `-vvv`.

```shell
mactop -vvv -l mactop.log
```

Then you can open another terminal `tail -f mactop.log` to see the logs.

Mactop use `powermetrics` to get metrics from your mactop, `powermetrics` is
different on different Macbooks. If you met some issue, better submit a
`powermetrics` sample in the issue, thanks.

Use this command (add `--debug`), Mactop will write json formatted powermetrics
file on your current `$(PWD)/debug_json`. (If you decide to paste it, only one
sample (one file) is enough).

```shell
$ mactop -vvv -l mactop.log --debug
$ ls debug_json
mactop_debug_20231206_16:34:28.json  mactop_debug_20231206_16:41:55.json  mactop_debug_20231206_16:46:21.json
mactop_debug_20231206_16:34:29.json  mactop_debug_20231206_16:44:46.json
```

## Development

This project use [poetry]() to manage dependencies.

Clone this project and make sure you have poetry.

```shell
pip install poetry
git clone git@github.com:laixintao/mactop.git
```

Then install dependencies:

```shell
poetry install
```

You can then make changes, and test with `poetry run mactop`.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mactop",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "laixintao",
    "author_email": "laixintaoo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f0/11/251d7efb6977fdf02f2c444430864c99beadb3ad24b0901965525053e58c/mactop-0.1.11.tar.gz",
    "platform": null,
    "description": "# mactop\n\nMactop is a tool like htop, but you can decide the data you want and decide the\nlayout. It is more like a Grafana for your macbook, but in terminal.\n\nIt looks like this:\n\n![](./assets/mactop.png)\n\n## Installation\n\n```shell\npip install mactop\n```\n\n## Usage\n\n```\nsudo mactop\n```\n\nIt requires `sudo` because `powermetrics` requires `sudo`, you can run `mactop`\nwithout `sudo` but some metrics will be missing.\n\nFor M1 Macbook users, please run:\n\n```\nsudo mactop -t m1.xml\n```\n\nWhat is `-t` here? It's for \"theme\"! And you can have your own theme!\n\n## Design Your Own Mactop\n\nWe use HTML + CSS style to setup the layout.\n\nYou can use `id` or `class` to select the element, like this:\n\n```html\n<Mactop>\n  <layout>\n    <Horizontal id=\"row-1\">\n      <SensorsPanel></SensorsPanel>\n    </Horizontal>\n  </layout>\n\n  <style>\n    #row-1 {\n      color: red;\n    }\n  </style>\n</Mactop>\n```\n\nSave your content to a file, for example, `my-theme.xml`, then run `mactop` with\n`mactop -t my-theme.xml`.\n\nComponents do not support inline-css, but you can set attributes on components.\n\nCommon attributes that every components support:\n\n- `id`;\n- `class` or `classes`, separated by space;\n- `refresh_interval`: set this will overwrite command line arguments\n  `--refresh-interval` for that component.\n\nFor component's supported attributes and component's name, please refer to\n`mactop/panels/__init__.py` and check the source code. Please bare with me, it\nis messy for now, I am working on documentations. If you have any questions,\nfeel free to open an issue.\n\nFor examples of layouts, you can refer `mactop/themes/` directory.\n\nIf you made some beautiful layout, please send it to me! By open a PR or issue,\nI can merge it into this repo, thanks.\n\n## Debug\n\nMactop comes with verbose log support.\n\n`-v` means enable `info` log, and more `v` means more logs, max `-vvv`.\n\n```shell\nmactop -vvv -l mactop.log\n```\n\nThen you can open another terminal `tail -f mactop.log` to see the logs.\n\nMactop use `powermetrics` to get metrics from your mactop, `powermetrics` is\ndifferent on different Macbooks. If you met some issue, better submit a\n`powermetrics` sample in the issue, thanks.\n\nUse this command (add `--debug`), Mactop will write json formatted powermetrics\nfile on your current `$(PWD)/debug_json`. (If you decide to paste it, only one\nsample (one file) is enough).\n\n```shell\n$ mactop -vvv -l mactop.log --debug\n$ ls debug_json\nmactop_debug_20231206_16:34:28.json  mactop_debug_20231206_16:41:55.json  mactop_debug_20231206_16:46:21.json\nmactop_debug_20231206_16:34:29.json  mactop_debug_20231206_16:44:46.json\n```\n\n## Development\n\nThis project use [poetry]() to manage dependencies.\n\nClone this project and make sure you have poetry.\n\n```shell\npip install poetry\ngit clone git@github.com:laixintao/mactop.git\n```\n\nThen install dependencies:\n\n```shell\npoetry install\n```\n\nYou can then make changes, and test with `poetry run mactop`.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Htop for macbook.",
    "version": "0.1.11",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b94a65bfa95e2d86f1ee9240249048cbe22722037aa52b370c5bff271ac90fa2",
                "md5": "a9d4e242b38c20be99ebd85b72b70904",
                "sha256": "255d85f540cd1ba4cf7dc0e0b4b388a27e75505d253c7796196b4ae0275bc180"
            },
            "downloads": -1,
            "filename": "mactop-0.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9d4e242b38c20be99ebd85b72b70904",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 56002,
            "upload_time": "2023-12-06T09:11:29",
            "upload_time_iso_8601": "2023-12-06T09:11:29.779154Z",
            "url": "https://files.pythonhosted.org/packages/b9/4a/65bfa95e2d86f1ee9240249048cbe22722037aa52b370c5bff271ac90fa2/mactop-0.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f011251d7efb6977fdf02f2c444430864c99beadb3ad24b0901965525053e58c",
                "md5": "e5cd57a56aac12759bcd0914e4c71a2a",
                "sha256": "3351f700c68afbd72383d1d62684e23bbbb62d0fe03a6b5a7fa713837d6b6fcc"
            },
            "downloads": -1,
            "filename": "mactop-0.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "e5cd57a56aac12759bcd0914e4c71a2a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 38536,
            "upload_time": "2023-12-06T09:11:32",
            "upload_time_iso_8601": "2023-12-06T09:11:32.499624Z",
            "url": "https://files.pythonhosted.org/packages/f0/11/251d7efb6977fdf02f2c444430864c99beadb3ad24b0901965525053e58c/mactop-0.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-06 09:11:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mactop"
}
        
Elapsed time: 0.35230s