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.
Development
Testing
- Create a test environment, e.g., with venv or conda.
- Ensure
powerline-statusandpytestare installed in your test environment. - Run
pytestinside thepowerline_diskspacefolder.
Deployment
- Read the official guide to refresh your memory, if needed.
pip install --upgrade build twinepython3 -m buildpython3 -m twine upload --verbose dist/*
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file powerline_diskspace-0.1.3.tar.gz.
File metadata
- Download URL: powerline_diskspace-0.1.3.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c879cfa3115aba8b0f52a148fcf0b94d7ee61134105b4a00f7ce706d6f9d49e
|
|
| MD5 |
bddd60f8d0e8f31a49fa9f6e6699e062
|
|
| BLAKE2b-256 |
4ea3bc8f06db6e0c225abda080d4489799c768f28558e60a09cc24c90a33fabe
|
Provenance
The following attestation bundles were made for powerline_diskspace-0.1.3.tar.gz:
Publisher:
python-publish.yml on AndreiBarsan/powerline-diskspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
powerline_diskspace-0.1.3.tar.gz -
Subject digest:
9c879cfa3115aba8b0f52a148fcf0b94d7ee61134105b4a00f7ce706d6f9d49e - Sigstore transparency entry: 206537122
- Sigstore integration time:
-
Permalink:
AndreiBarsan/powerline-diskspace@34dc703c98c7e97d966d23910b6eb95c7323a611 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/AndreiBarsan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@34dc703c98c7e97d966d23910b6eb95c7323a611 -
Trigger Event:
release
-
Statement type:
File details
Details for the file powerline_diskspace-0.1.3-py3-none-any.whl.
File metadata
- Download URL: powerline_diskspace-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3cdc7de11e978de4b3e04a3b53458f46487cb2bfab076d6b8ac923fb492aa27
|
|
| MD5 |
7624f77b351768528b2251569ce45e39
|
|
| BLAKE2b-256 |
388ed895f3abd82e1217da7c326f1bb53e529e3c23120242acd3bc98ffd07c75
|
Provenance
The following attestation bundles were made for powerline_diskspace-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on AndreiBarsan/powerline-diskspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
powerline_diskspace-0.1.3-py3-none-any.whl -
Subject digest:
d3cdc7de11e978de4b3e04a3b53458f46487cb2bfab076d6b8ac923fb492aa27 - Sigstore transparency entry: 206537123
- Sigstore integration time:
-
Permalink:
AndreiBarsan/powerline-diskspace@34dc703c98c7e97d966d23910b6eb95c7323a611 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/AndreiBarsan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@34dc703c98c7e97d966d23910b6eb95c7323a611 -
Trigger Event:
release
-
Statement type: