Tobi Lutke 75d657d57a app: colour that means something, a side panel, the whole disk
- Tiles are coloured by kind at one muted level, lighter with depth, and
  hatched where the space can be had back. Age mode colours by last write.
  Top-level directories carry a strip of their colour.
- One highlight, the theme's amber: selection, the main action, what the
  marks free. Outlines paint after every fill and snap to device pixels.
- A resizable side panel replaces the bottom bars: the selection with its
  size set large, share, files, last write and git state (changes,
  stashes, unpushed); worth a look; the marked list with a way off it; and
  the disk, free now and after, with the review button carrying the
  saving it would make.
- Home or the whole disk, from the top bar or with g.
- The mosaic stops hovering when the pointer leaves it, so its tooltip
  never covers the panel handle.
2026-09-24 16:42:08 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00
2026-09-24 15:56:19 -05:00

disktree

Find what is filling a disk, mark what should go, and remove it — with the volume's free space in view the whole time.

disktree is a treemap for Omarchy. It scans your home directory by default, draws every directory as a nested mosaic sized by what it really costs on disk, and lets you walk into it with the keyboard or the mouse. Mark as much as you like; nothing happens until you review the list and commit, and the permanent path always asks first.

Built with GPUI through gpui-omarchy, so it follows your Omarchy theme and behaves like the rest of the desktop.

Install

git clone https://github.com/tobi/disktree
cd disktree
make install

make install builds a release binary and puts three things under ~/.local (no root needed):

  • ~/.local/bin/disktree
  • a desktop entry, so disktree is in the launcher and in a file manager's Open with for a directory (it adds a handler; it never becomes the default)
  • an icon

sudo make install PREFIX=/usr/local installs system-wide; make uninstall removes exactly what was installed.

You need Rust 1.97 or newer and a Wayland or X11 session with a GPU that GPUI can drive (Vulkan).

Use

disktree            # scan the home directory
disktree ~/src      # or any directory
disktree --help     # options: apparent size, follow links, skip hidden, …

The screen

  • Top: the scan totals on the left; on the right, what is measured — rank by Size or Files, Hidden files, Apparent size, and how many levels are drawn. Below it, the breadcrumb: click any part to go there.
  • Middle: the treemap, using the full width of the window. Every directory that is drawn open keeps a band at its top with its own name and size, and its contents sit below that band — so a parent's name never covers a child, and pointing at the band selects the parent.
  • Bottom: the tile you are acting on (name, path, size, its share of its directory and of the scan, Open, Mark for removal); then the marked total with Review…, the volume's free space now and after the marks, and how much of the tree could be read.

Marking

Space, X, Enter and the arrows act on the tile under the mouse if the mouse moved last, and on the keyboard selection after you use an arrow or Tab. The tile you mark is hatched in the danger colour. Marking is reversible — press it again — and a path inside a marked directory is shown as going with it, so the saving is never counted twice.

Zooming and going in

Scroll to magnify toward the pointer. The wheel magnifies until the directory under the pointer fills the view, and the next notch goes into it — one continuous motion, with the directory's contents growing into place. Scroll the other way to come back out. Enter goes into the selected directory at any depth, and Backspace or Escape goes up one level. + and - magnify without going in; 0 resets.

Removing

c (or Review…) opens the list of everything marked. Unmark anything there, then choose:

  • Move to trash — the default when a trash is available (trash-put from trash-cli, then gio trash, then a built-in XDG trash). Recoverable until the trash is emptied, so it commits directly.
  • Delete permanently — rm -rf semantics. It always asks first, in a dialog that names what goes and how much comes back.

When it finishes, disktree scans again so the numbers on screen match the disk, and shows how much free space was actually gained.

Keys

key does
space / x mark or unmark the tile you point at
ctrl-click mark without moving the selection
enter open that directory, at any depth
⌫ / esc go up one directory
← ↑ ↓ → move between tiles at this level
tab next largest sibling
scroll zoom toward a directory, then go into it
shift-scroll pan the magnified view
[ ] draw fewer or more levels at once
- = 0 magnify, shrink, reset the view
ctrl = ctrl - ctrl 0 interface zoom
/ find an entry by name
c review the marked list
t rank by size or by file count
d disk usage or apparent size
i include or skip hidden entries
r scan again
p show or hide the selection line
? every key
q quit

On the review screen: m trash, p permanent, ! unmark all, enter commits, esc goes back.

What it measures

  • Disk usage by default: st_blocks × 512, the number du reports and the space that actually comes back when a file is deleted. Apparent size (what ls -l shows) is one toggle away.
  • Hardlinks once. Two names for one inode cost one file.
  • Hidden entries included, because ~/.cache is often the biggest thing in a home directory. Symlinks are not followed.

The scan follows dust's approach: one rayon scope per root, a completion counter per directory so no directory is built before its last subdirectory lands, and one bottom-up pass that aggregates sizes and removes duplicate hardlinks.

What it refuses to do

The removal rules live in crates/disktree-core/src/removal.rs, and each one is tested:

  • only paths under the scanned root can be removed;
  • the filesystem root, the scanned root and your home directory are refused;
  • a mount point is refused, since removing it would reach into another filesystem;
  • a symlink is unlinked, never followed;
  • nothing is passed through a shell — a file called -rf is just a file.

On Hyprland

Hyprland tiles new windows, so disktree opens into whatever tile it is given. It is designed for a roomy window; float it, or give it a rule:

windowrule = float, class:^(disktree)$
windowrule = size 1400 900, class:^(disktree)$

Develop

make run      # release build, scanning $HOME
make lint     # rustfmt --check, then clippy with every warning an error
make test     # scanner, layout and removal tests, plus window-harness tests
make ci       # lint, then test

The lint gate is strict on purpose: clippy::all and clippy::pedantic are errors, and every exception is written down with its reason in Cargo.toml. The window-harness tests draw real frames and press real keys — including one that marks a directory, confirms the deletion and checks that the files are gone while their neighbours are not.

path what lives there
crates/disktree-core scanning, the tree, the squarified layout, free space and removal — no UI
crates/disktree-app/src/state.rs every action the interface can take, and the key map
crates/disktree-app/src/views.rs the screens
crates/disktree-app/src/treemap_view.rs painting the mosaic and its labels
crates/disktree-app/src/ui.rs the spacing, type and size scale, in rem
crates/disktree-app/src/tests.rs end-to-end tests through a real window
packaging/, assets/, Makefile the desktop entry, the icon, and install

The interface follows the GPUI Kit design guides: every size is on one rem scale so interface zoom keeps its proportions, primary is reserved for what Enter does, and the only question the app asks is the one it cannot take back.

License

MIT

S
Description
A treemap for finding and removing what fills your disk, for Omarchy. Rust + GPUI.
Readme MIT
9.1 MiB
Languages
Rust 98.6%
Python 0.4%
Makefile 0.3%
TypeScript 0.2%
PowerShell 0.2%
Other 0.3%