trashguard

dev.trashguard.app
by LeBotDuFutur

A small Linux utility that automatically cleans the trash based on item age and/or total size.

# trashguard A small Linux utility that automatically cleans the trash based on item age and/or total size. ## Prerequisites - Linux - systemd (required for the `install` command) - Rust and Cargo (only required when building from source) ## Building With cargo ```bash cargo build --release ``` With nix ```bash nix build ``` ## Installation This tool will be packaged for the most popular Linux distributions and uploaded to crates.io from a certain star rating. ## Usage Run the following command to display the available commands: ```bash trashguard help ``` Output: ```bash A program that allows you to regularly empty the trash Usage: trashguard [OPTIONS] <COMMAND> Commands: run Run the trash cleanup install Install a systemd service to run the cleanup every day uninstall Uninstall the systemd service help Print this message or the help of the given subcommand(s) Options: -d, --debug Enables information messages -h, --help Print help -V, --version Print version ``` Run the following command to view the available cleanup settings: ```bash trashguard run help ``` Output: ```bash Run the trash cleanup Usage: trashguard run [OPTIONS] Options: -d, --debug Enables information messages -m, --mode <MODE> Element deletion mode [default: both] [possible values: date, size, both] --max-days <MAX_DAYS> The maximum number of days an item remains in the trash [default: 14] --max-size <MAX_SIZE> The amount of data that the trash should not exceed [default: "10.0 GiB"] -h, --help Print help ``` ### Example The following command will delete all items from the trash that have been there for more than 7 days. ```bash trashguard run --mode date --max-days 7 --debug ``` ## How it works The program retrieves various information about all the items present in the Recycle Bin. Then it sorts all the items from newest to oldest. Afterwards, it goes through all the elements until the cleaning criterion is no longer respected. Once the criterion is no longer met, all remaining elements in the list are permanently deleted. Note: with _both_ mode, the elements are deleted as soon as one of the two criteria is no longer respected. By default, `trashguard` removes items that: - are older than 14 days, and/or - cause the trash to exceed 10 GiB. The cleanup can be run manually with `trashguard run`, or scheduled daily using the systemd service installed with `trashguard install`. ## Development Enter the development environment: ```bash nix develop ```

First release: Sep 18, 2026, 1 total release.

Most recent release: Sep 18, 2026.

Repo

Appears in 0 app stacks.

0 sats / 0 zaps received in the past year.

Sats Received

Underlying data available via MCP: app_zaps, app_releases.

Zap Count

Underlying data available via MCP: app_zaps, app_releases.

Releases

  • Sep 18, 2026 0.1.0
    First version !