Skip to content

AndreiBarsan/powerline-diskspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

disk utilization example

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 vim should work to)

Installation steps:

  1. Install the Python package: pip install powerline-diskspace.
  2. Update your powerline (not tmux!) config following the example above.
  3. 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.

About

A powerline segment for displaying disk utilization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages