Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omarchy-diskspace

How full your disks are, in your Omarchy bar.
One filesystem on the bar, every one of them in a panel — with a warning before you run out.

Install · Using it · Configuration · Standalone · How it works


Omarchy's bar covers CPU-adjacent things well, but nothing tells you a disk is about to fill up until something fails. This is that widget: a compact percentage on the bar, a panel that meters every mounted filesystem, and a threshold that turns the reading your theme's urgent colour before it becomes a problem.

Features

  • Every real filesystem, metered — internal disks, external drives, network mounts; each with a usage bar, used/total, free space, and type
  • Warns early — the bar reading goes urgent past a threshold you set, and by default it watches whichever filesystem is fullest, not just the one on show
  • Honest percentages — computed from used/size, so the meter and the numbers in the panel always agree with each other
  • Subvolume-aware — btrfs subvolumes collapse into one row per device rather than pretending you have four disks that are all 60% full
  • Keyboard-navigable panelj/k to move, Enter to open the mount in your file manager, r to re-measure, Esc to close
  • Robust parsing — reads findmnt --json, so mount points with spaces in them (external drives named from a filesystem label) parse correctly
  • Cheap — one short-lived process every 30s by default; disk usage does not move fast enough to deserve more
  • Stable width — the reading is left-padded in the monospace bar font, so neighbouring widgets don't shuffle sideways as digits come and go
  • Run more than oneallowMultiple is on, so you can pin / and /home as separate bar segments
  • Theme-native — built from Omarchy's own bar and panel components
  • Reusable coreDiskCore.qml has no Omarchy dependency and works in any Quickshell config

Install

omarchy plugin add https://github.com/tpatzelt/omarchy-diskspace.git --enable --yes

That clones into ~/.config/omarchy/plugins/tpatzelt.diskspace/ and adds the widget to the right-hand bar section. Move it wherever you like:

omarchy bar move tpatzelt.diskspace --section right

Plugins run as unsandboxed code inside omarchy-shell. Omarchy deliberately installs them disabled unless you pass --enable, so you can read the source first. It's two short QML files.

Manual install

git clone https://github.com/tpatzelt/omarchy-diskspace.git \
  ~/.config/omarchy/plugins/tpatzelt.diskspace
omarchy-shell shell rescanPlugins
omarchy plugin enable tpatzelt.diskspace

Updating

omarchy plugin update tpatzelt.diskspace

Uninstall

omarchy plugin remove tpatzelt.diskspace

Using it

Action What it does
Left-click Open the panel
Right-click Re-measure (or run your own command — see onRightClick)
Middle-click Re-measure
Hover Used, total and free for the filesystem on the bar
j / k, / Move between filesystems
Enter Open the selected mount in your file manager
r Re-measure
Tab Move to the next bar panel
Esc Close

The panel can also be opened from anywhere:

omarchy-shell tpatzelt.diskspace toggle

Configuration

Settings live inline in the widget's entry in ~/.config/omarchy/shell.json. Changes there hot-reload; you do not need to restart the shell.

{
  "id": "tpatzelt.diskspace",
  "mount": "/home",
  "display": "free",
  "warnPercent": 85,
  "exclude": ["/boot"]
}
Key Default What it does
interval 30 Seconds between measurements
mount "/" Which filesystem the bar reading summarises. Falls back to the fullest mount if absent
display "percent" percent (23%), free (201G), or used (60G/274G)
warnPercent 90 Above this the reading uses the theme's urgent colour. 0 disables
warnOnAnyMount true Warn when any filesystem crosses the threshold, not just the one shown
showIcon true Turn off for a text-only readout if your font lacks Nerd Font glyphs
showLabel false Prefix the reading with a short name for the mount
mounts [] Only show these mount points. Empty means every real filesystem
exclude [] Hide these mount points
minSizeGb 1 Ignore filesystems smaller than this
dedupe true Collapse mounts that share a device and size into one row
onOpen "xdg-open" Run with the mount point appended when a row is activated. Empty disables
onRightClick "" Empty means right-click re-measures
diskIcon "" Nerd Font glyph for the bar and panel
warnIcon "" Glyph used once the threshold is crossed

Two disks on the bar

allowMultiple is enabled, so add the widget twice and point each copy at a different filesystem:

{ "id": "tpatzelt.diskspace", "mount": "/",     "showLabel": true },
{ "id": "tpatzelt.diskspace", "mount": "/home", "showLabel": true }

Standalone Quickshell

DiskCore.qml is plain QtQuick plus Quickshell.Io — no Omarchy imports, no compositor assumptions. Copy it next to your own shell.qml and bind to it:

DiskCore {
  id: disk
  intervalMs: 5000
}

Text {
  text: disk.ready
    ? Math.round(disk.primary.percent) + "% of " + disk.primary.target + " used"
    : "measuring…"
}

A runnable example lives in examples/standalone:

./scripts/run-example.sh

Quickshell only scans QML inside the config directory it is pointed at, so DiskCore.qml has to sit next to the shell.qml that uses it — the script assembles a temporary directory containing both.

Core API

Property Type Notes
ready bool False until the first measurement has been parsed
mounts array { source, target, fstype, size, used, avail, percent, label }, fullest first
primary object The entry for primaryMount, or the fullest one if it is absent
fullest object The fullest filesystem
lastError string Empty unless the mount table could not be read
refresh() Re-measure now
formatSize(bytes) string 274G, 1.9G, 109M

How it works

findmnt --json, not df. df pads its columns to align them, and a mount point containing a space — routine for a removable drive named from its filesystem label — cannot be recovered from that layout without guessing. findmnt --json --list --bytes --real emits real JSON with byte counts already parsed, so nothing here has to slice columns. --real also drops the pseudo filesystems that would otherwise dominate the list.

Percentages are derived, not borrowed. df reports capacity against the total minus ext4's root-reserved blocks, so its figure and a used/size calculation disagree by a few points. Rather than show a bar that doesn't match its own caption, the percentage here is always used / size.

Subvolumes collapse by default. On btrfs, /, /home and /var are frequently three mounts of one pool reporting one set of numbers. Left alone that reads as three disks in identical trouble, so entries sharing a source device and total size are merged.

One highlight at a time. The panel follows the first-party pattern: hover and j/k write to the same cursor state on the root, so the mouse and the keyboard can never paint two selected rows.

Requirements

  • Omarchy 4 (Quattro) or newer, with omarchy-shell
  • findmnt — part of util-linux, already on any Arch system
  • A Nerd Font for the glyphs (Omarchy's default bar font has them). Set showIcon: false if yours doesn't

Related

License

MIT — see LICENSE.

About

Filesystem usage in the Omarchy bar — one disk on the bar, all of them in a panel, with a warning before you run out.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages