Skip to content
e2goonPublic

About

Disk cleaner for Omarchy: an oms CLI and a shell bar widget that sweep package caches, old tool versions, Docker, developer and browser caches, and stale project builds.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

omasweep

English · 한국어

Reclaim disk space on Omarchy. omasweep is a terminal cleaner (oms) plus an Omarchy shell bar widget. It knows where an Arch + Hyprland machine piles up space: the pacman cache, old mise tool versions, Docker and Podman, package caches for every language Omarchy sets up, browser and Electron app caches, Flatpak, Steam and Wine, AI model caches, and build output in projects you stopped touching. More than 60 targets, and only the ones present on your machine show up.

oms scan in Ghostty, listing safe items, review items, and caches skipped while their app is open

Highlights

  • Ranked by value. Safe items come first, largest first, and are preselected. Items that cost you something (Trash, shader caches, project dependencies, orphaned packages) are listed but stay opt-in.
  • You pick, then it sweeps. A checklist (via gum) lets you toggle items, then you confirm once. --dry-run shows exactly which commands would run and which directories would be emptied.
  • Uses each tool's own cleanup. mise prune, docker builder prune, paccache, journalctl --vacuum-time, uv cache prune, go clean, and pnpm store prune instead of deleting their data behind their back.
  • Leaves running apps alone. Caches of an open browser, Electron app, Flatpak app, or game launcher are skipped, and the check runs again right before sweeping.
  • Omarchy-native. Follows the active theme (ANSI palette and Omarchy's gum colors), keeps two package versions like omarchy update does, opens in Omarchy's floating terminal from the bar, and asks for sudo in that terminal only when a selected item needs it.
  • Honest numbers. The summary shows what was swept and how much free space actually changed. When those differ (Btrfs snapshots or hard links still hold the data), it says so.

Install

Bar widget and CLI

omarchy plugin add https://github.com/e2goon/omasweep.git --enable
~/.config/omarchy/plugins/io.github.e2goon.omasweep/bin/oms link

The first command installs the widget into the bar. The second links oms into ~/.local/bin so you can run it from any terminal. omarchy plugin update io.github.e2goon.omasweep updates both.

omasweep bar widget popup with the safe total, top items, and Sweep and Preview buttons

The widget shows how much can be swept safely and the largest items. Sweep and Preview open oms in Omarchy's floating terminal, where you pick and confirm every item. When / has less than 10 GB free, the space omarchy update needs before it will run, the icon turns to the urgent color and the popup says so. On a vertical bar the widget shows only its icon.

CLI only

git clone https://github.com/e2goon/omasweep.git ~/.local/share/omasweep
~/.local/share/omasweep/bin/oms link

Requirements: Bash 5, coreutils, findutils, and jq (for oms scan --json and the widget). gum is used when present and ships with Omarchy. Tools such as mise, docker, paccache (pacman-contrib), uv, or pnpm are only used when installed; their targets are skipped otherwise.

Uninstall

rm ~/.local/bin/oms
omarchy plugin remove io.github.e2goon.omasweep

The first command removes the oms link. The second takes the widget off the bar and deletes the plugin. For a CLI-only install, run rm -rf ~/.local/share/omasweep instead of the second command. To also drop your whitelist and the operation log, run rm -rf ~/.config/omasweep ~/.local/state/omasweep.

Usage

oms                         # scan, pick, confirm, sweep
oms scan                    # show what can be reclaimed, change nothing
oms clean --dry-run         # walk through a sweep without deleting anything
oms clean --yes             # sweep every safe item without prompts
oms clean --only mise,docker-build
oms clean --all --skip trash
oms whitelist               # protect paths or whole targets
oms log                     # what was removed, skipped, or failed
Option Meaning
-n, --dry-run Preview the sweep. Nothing is deleted and nothing is logged.
-y, --yes Do not ask. Sweeps the safe items unless --all or --only is given.
-a, --all Preselect review items too.
--only ID,... Sweep only these targets. IDs are listed by oms scan.
--skip ID,... Leave these targets out.
--debug Print each command and its output.
--hold Wait for a key before exiting. The bar widget uses this.

Without a terminal, oms clean refuses to run unless you pass --yes or --dry-run. Running it as root is refused as well; it asks for sudo itself.

What it sweeps

Only targets that exist on your machine show up. Run oms scan to see them with their IDs.

How targets are chosen

  • Safe targets hold data their owner recreates on its own: download caches, build caches, logs, crash dumps, and tool versions no config refers to. The only cost is a re-download or a rebuild. They are preselected.
  • Review targets cost something noticeable or may hold things you want: Trash, offline music, AI models, shader caches (games stutter while they rebuild), project dependencies, and container images. They are listed but stay opt-in.
  • Never touched: logins, cookies, history, settings, local storage, mail, game saves, Wine prefixes, Steam compatdata, Docker volumes and containers, project sources, the Maven repository (it can hold artifacts you built locally), NuGet packages, and Ollama models (use ollama rm).
  • Also never touched on Omarchy: browser Service Worker storage (Omarchy web apps share the Chromium profile), AI agent sessions and worktrees (~/.claude, ~/.codex, opencode data; the omarchy.agents widget reads them), Superwhisper recordings and models, cloud CLI credentials (~/.aws), ~/Work/tries experiments as a whole, AppImages, Omarchy's own state, and snapshots.
  • Orphaned packages are left to omarchy update, which removes them on every update. The old orphans ID is still accepted by --only and --skip and is ignored with a note.
  • When a tool has its own cleanup command, omasweep calls it instead of deleting the tool's data.
  • Caches of running apps are skipped. Chromium-based browsers and Electron apps are detected by the SingletonLock in their profile, Firefox-based browsers by the profile lock, Flatpak apps by flatpak ps, and everything else by process name. The check runs again right before sweeping.
  • Symlinked cache folders are never followed, and nothing outside $HOME is deleted except through the fixed sudo commands listed below.

System

ID What Tier How
pacman Cached versions of removed packages, plus versions past two (omarchy update already prunes those) safe, sudo paccache -rk2 and paccache -ruk0
pacman-downloads download-* folders an interrupted update left in the pacman cache safe, sudo remove them
journal Archived journal files older than four weeks safe, sudo journalctl --vacuum-time=4weeks
coredumps systemd-coredump archive safe, sudo delete files in /var/lib/systemd/coredump
flatpak-unused Flatpak runtimes no installed app needs safe, sudo flatpak uninstall --unused (user and system)
thumbnails Thumbnail cache safe empty ~/.cache/thumbnails
partial-downloads .crdownload and .part files in Downloads untouched for 7 days and not open (needs fuser) safe remove the files
trash Trash review empty ~/.local/share/Trash
installers .deb, .rpm, .pkg.tar.*, .iso, .dmg, .exe, .msi in Downloads untouched for 30 days review remove the files

Containers

ID What Tier How
docker-build Docker build cache safe docker builder prune -af
docker-images Every image no container uses, including ones you pulled on purpose review docker image prune -af
podman-images The same for Podman review podman image prune -af

Omarchy 4.5 keeps your user out of the docker group, so Docker runs through sudo. When sudo needs no password at that moment, omasweep measures and prunes through sudo -n docker. Otherwise, if Docker has stored data, the Docker rows show an unknown size, ask for sudo, and stay opt-in. A Docker that never ran is not listed, even though Omarchy enables its socket.

Developer tools

ID What Tier How
mise Tool versions no mise config refers to safe mise prune
mise-cache mise download cache safe mise cache clear
ai-cli-versions Old Claude Code, Cursor Agent, and GitHub Copilot CLI builds, keeping the active one and one previous safe remove the older builds
aur yay, paru, and pikaur build clones safe empty their cache folders
npm, pnpm, yarn, bun, deno, corepack JavaScript package caches safe empty the cache folders
pnpm-store Store packages no project links to safe pnpm store prune
uv, pip, poetry Python package caches safe uv cache prune, empty the others
go-build Go build cache safe go clean -cache
cargo, rustup Crate archives and rustup downloads (sources and toolchains stay) safe empty the folders
gradle Gradle build cache and daemon logs (downloaded dependencies stay) safe empty the folders
composer, ruby, dotnet, beam, jvm-tools, zig, ccache, opam, android Composer, RubyGems and Bundler, NuGet HTTP, Hex and rebar3, Coursier, Zig, ccache, opam, and Android build caches safe empty the cache folders
tool-caches node-gyp, Electron, TypeScript, Vite, webpack, ESLint, Prettier, Ruff, mypy, pre-commit, Prisma, pyenv downloads safe empty the cache folders
gh GitHub CLI API cache safe gh config clear-cache
cloud-cli kubectl discovery cache, gcloud and Azure CLI logs (credentials and configs stay) safe empty the folders
go-mod Go module cache review go clean -modcache
test-browsers Playwright, Puppeteer, and Cypress browsers review empty the cache folders
jetbrains JetBrains IDE caches and indexes review empty ~/.cache/JetBrains

Browsers

ID What Tier How
chromium, chrome, edge, brave, vivaldi, opera ~/.cache/<browser> plus code, GPU, and shader caches inside the profile safe empty the cache folders
firefox, zen, librewolf ~/.cache/<browser> safe empty the cache folder
browser-ai-models On-device AI models in Chrome, Edge, Chromium, and Brave profiles (OptGuideOnDeviceModel), often several GB review empty the model folders

Apps

ID What Tier How
app-caches Cache folders of every Electron or Chromium-based app found in ~/.config (VS Code, Obsidian, Discord, Slack, Signal, ...) safe empty Cache, Code Cache, GPUCache, Dawn*Cache, CachedData, Crashpad
flatpak-caches ~/.var/app/*/cache safe empty the cache folders
spotify Spotify cache, including songs saved for offline listening review empty ~/.cache/spotify
kdenlive Kdenlive proxy clips and previews review empty ~/.cache/kdenlive
qt-caches Compiled QML and shader caches of Qt Quick apps, including Omarchy's omawrite, omacalc, hype, monologue, and omacut safe empty qmlcache, qtshadercache-*, qtpipelinecache-*
zed Zed temp files, logs, and its npm cache (extensions, languages, and settings stay) safe empty the folders
gpu-shaders Mesa, RADV, and NVIDIA shader caches review empty the cache folders

Games

ID What Tier How
steam-cache Steam store page cache and logs safe empty the folders
steam-shaders Steam shader cache review empty steamapps/shadercache
wine-caches winetricks downloads, Lutris and Heroic caches review empty the cache folders

AI

ID What Tier How
huggingface Hugging Face hub cache review empty the cache folders
ml-models PyTorch hub and Whisper models review empty the cache folders
lmstudio LM Studio models review empty the models folder
opencode OpenCode provider packages and tools (sessions stay) safe empty ~/.cache/opencode

Projects

ID What Tier How
project-artifacts node_modules, .next, .nuxt, .output, .svelte-kit, .astro, .expo, .turbo, .parcel-cache, .angular, coverage, Rust and Maven target, Python .venv/venv, .tox, .nox, .pytest_cache, .mypy_cache, .ruff_cache, .gradle, .cxx, .dart_tool, Zig .zig-cache/zig-out, and Composer vendor in projects untouched for 30 days review remove the folders

A folder only counts when its project marker sits next to it (package.json, Cargo.toml, pyvenv.cfg, composer.json, ...). Only the outermost match is taken, folders directly in $HOME are ignored, target folders with a deploy directory (Solana keys) are kept, and Go or Rails vendor folders are left alone. A folder git tracks files in is kept whatever its name, so a committed coverage report or vendored code stays. dist, build, bin, and obj are never taken, since they too often hold committed output. Each project is checked again right before removal.

Btrfs snapshots are not deleted; if a sweep frees less than expected on a snapper-managed root, omasweep tells you to review sudo snapper list.

After omarchy update

omarchy update needs 10 GB free on / and refuses to start below that. oms scan, oms clean, and the widget warn when free space drops under it.

Every update also runs mise up and pulls new packages, so caches pile up. An optional hook scans in the background after each update and sends a notification with a Sweep button when more than OMS_NOTIFY_GB (default 5) can be swept safely. It never deletes anything itself:

install -Dm644 ~/.config/omarchy/plugins/io.github.e2goon.omasweep/hooks/post-update \
  ~/.config/omarchy/hooks/post-update.d/omasweep

Remove that file to turn it off.

Whitelist

oms whitelist opens ~/.config/omasweep/whitelist. One entry per line:

# Skip a whole target
docker-images

# Never delete this path or anything below it. Globs work.
~/.cache/pnpm
~/Work/keep-this/node_modules

Settings

Variable Default Meaning
OMS_PACMAN_KEEP 2 Package versions kept in the pacman cache
OMS_JOURNAL_KEEP 4weeks Journal age kept by journalctl --vacuum-time
OMS_STALE_DAYS 30 Days without changes before project build output or a downloaded installer counts as stale
OMS_PROJECT_DIRS ~/Projects:~/projects:~/Code:~/code:~/src:~/dev:~/Work:~/work Where to look for project build output
OMS_NOTIFY_GB 5 Safe total, in GB, above which the post-update hook notifies
NO_COLOR unset Disable colors

The widget has two settings. showSize puts the safe total next to the icon, and refreshIntervalMin sets how often that total is rescanned:

omarchy bar set io.github.e2goon.omasweep showSize true --json
omarchy bar set io.github.e2goon.omasweep refreshIntervalMin 60 --json

Files

Path Purpose
~/.config/omasweep/whitelist Protected paths and skipped targets
~/.local/state/omasweep/operations.log Every removal, command, skip, and failure (rotated at 5 MB)

Development

git clone https://github.com/e2goon/omasweep.git ~/Work/omasweep
ln -s ~/Work/omasweep ~/.config/omarchy/plugins/io.github.e2goon.omasweep
omarchy-shell shell rescanPlugins
omarchy plugin enable io.github.e2goon.omasweep
tests/run.sh

tests/run.sh never touches your system. It:

  • checks syntax, runs shellcheck when installed (uvx --from shellcheck-py shellcheck works too), runs qmllint against the Omarchy shell modules, and validates the plugin manifest
  • replaces sudo, paccache, pacman, journalctl, mise, docker, uv, go, gh, fuser, pnpm, flatpak, and ps with stubs that record their arguments, so every cleanup command is checked exactly
  • sweeps a throwaway home directory and confirms what is removed and what survives: whitelisted paths, symlink targets, caches of running apps, recent projects, and anything outside $HOME

After editing BarWidget.qml through a symlinked checkout, run omarchy restart shell to load the change.

The plugin follows the Omarchy shell plugin manual and shell reference.

Credits

The CLI flow (dry run, whitelist, operation log, in-use deferral, and the free-space summary) is inspired by Mole, the macOS cleaner by tw93. omasweep shares no code with Mole and is not affiliated with it.

License

MIT

About

Disk cleaner for Omarchy: an oms CLI and a shell bar widget that sweep package caches, old tool versions, Docker, developer and browser caches, and stale project builds.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages