Skip to content

clorteau/waybardf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A module for Waybar that monitors the storage space of mount points

screenshot

Dependencies

  • Python
  • df

Download

Download waybardf.py anywhere you have permission to read it.

Usage

In your waybar's .jsonc, add one entry per mount point you want to monitor.

Examples:

"custom/df1": {
    "format": "🖴 {text}",
    "exec": "~/scripts/waybar/waybardf.py /",
    "return-type": "json",
    "interval": 30,
    "on-click": "pcmanfm-qt"
  },
  "custom/df2": {
    "format": "🖴 {text}",
    "exec": "~/scripts/waybar/waybardf.py -l backups /mnt/backups",
    "return-type": "json",
    "interval": 30,
    "on-click": "pcmanfm-qt /mnt/backups"
  },

This module exposes 3 css classes for styling:

  • 'normal'
  • 'warning' when space usage is over 90%
  • 'critical' when space usage is over 98%

Example of 'style.css':

#custom-df1.normal, #custom-df2.normal {
  background: @background-primary;
}
#custom-df1.warning, #custom-df2.warning {
  background: darkorange;
}
#custom-df1.critical, #custom-df2.critical {
  background: darkred;
}

The script takes 2 arguments:

  • optional '--label': label to use instead of the mount point's path
  • the mount point
./waybardf.py --help
usage: waybardf.py [-h] [-l LABEL] [-d] mountpoint

Waybar module for displaying the storage space used/available on 1 mount point

positional arguments:
  mountpoint         mount point - ex: '/mnt/backups'

options:
  -h, --help         show this help message and exit
  -l, --label LABEL  label to be displayed (defaults to the full mount point path)
  -d, --debug

About

A module for waybar for displaying storage space statistics of mount points

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages