A Powerline segment for displaying local disk utilization.
Project description
Powerline Disk Utilization Indicator
A tiny Powerline segment I wrote (originally for tmux) to show me disk space utilization in its status line. This component does not work natively with tmux - if you just want a native tmux-specific component, check out tmux-df.
Here is a screenshot of this segment in action:
The root / is red because, unlike /cache, it's over the critical_threshold I set to 40% for this example.
In this case, the relevant part of the powerline config (cat ~/.config/powerline/themes/tmux/default.json) is:
{
"segments": {
"right": [
{
"function": "powerline_diskspace.diskspace.Diskspace",
"priority": 30,
"args": {
"format": "{mounted_on} @ {capacity:.0f}%",
"mount_ignore_pattern": "(/snap|/dev|/run|/boot|/sys/fs)",
"show_when_used_over_percent": {
"/": 20,
},
"critical_threshold": 40
}
}
]
}
}
(Other plug-ins featured in the screenshot, like uptime, are not shown.)
Getting Started
System requirements:
- Linux (macOS support is only partial)
- Python 3.8+
- Powerline set up and in use (code only tested in tmux, but other places like
vimshould work to)
Installation steps:
- Install the Python package:
pip install powerline-diskspace. - Update your
powerline(nottmux!) config following the example above. - Restart the Powerline daemon:
powerline-daemon --replace
If you have any questions or encounter issues setting up, please don't hesitate to open up an issue on GitHub!
Customization
There are many ways to customize your output. Please refer to the __call__ method in diskspace.py, which is essentially the "main function" of the segment for more documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for powerline_diskspace-0.1.2.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 7657b341d2d4528c7c29c70c6af240d6369eccf6df9bd51f80e52d028f972927 |
|
| MD5 | b5ebbf4a1352af4ce1b667d70a5baef1 |
|
| BLAKE2b-256 | e1fb802f01e69daea58ad4c72d722f6e703af0f99a922e8869bb8b0254cde69b |
Hashes for powerline_diskspace-0.1.2-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 78290b80cf7d6d9fc20d5c6f3f17cf1ea66ed93b1a11fc61526dacf2434ac13c |
|
| MD5 | 19bd1f74c8daad65bb0d6b441cf4f5a2 |
|
| BLAKE2b-256 | 7a313ec1d739440903eb8e96a0ff0ce87b35db6ace96abc39f6b480a111b3ab6 |