{"id":22675530,"url":"https://github.com/chamilad/trash-rs","last_synced_at":"2026-01-12T14:02:40.597Z","repository":{"id":228761411,"uuid":"774842678","full_name":"chamilad/trash-rs","owner":"chamilad","description":"A freedesktop.org trash spec implementation in Rust","archived":false,"fork":false,"pushed_at":"2024-10-11T00:47:30.000Z","size":557,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-06T17:54:24.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chamilad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T09:43:50.000Z","updated_at":"2024-10-11T00:46:20.000Z","dependencies_parsed_at":"2024-04-04T20:32:21.510Z","dependency_job_id":"d492a422-2a35-43c0-9702-089584f2820a","html_url":"https://github.com/chamilad/trash-rs","commit_stats":null,"previous_names":["chamilad/trash-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chamilad/trash-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilad%2Ftrash-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilad%2Ftrash-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilad%2Ftrash-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilad%2Ftrash-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chamilad","download_url":"https://codeload.github.com/chamilad/trash-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilad%2Ftrash-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T17:45:51.378Z","updated_at":"2026-01-12T14:02:40.588Z","avatar_url":"https://github.com/chamilad.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# freedesktop.org Trash Spec Implementation for the CLI\n\nThis is a [freedesktop.org Trash\nSpec (v1.0)](https://specifications.freedesktop.org/trash-spec/) implementation\nwritten in Rust for the CLI. It has two binaries, `trash` for trashing files,\nand `restore` for a TUI for browsing and managing trashed files. These two\nbinaires are independent, meaning they can work without the other present (ex: you\ncan restore a file trashed using another implementation).\n\nThe full specification is implemented, including `directorysizes` section which\nis sometimes ignored by desktop environment implementations.\n\n![Restore TUI](./docs/restore-screen.png)\n\n\u003e DISCLAIMER: This is still in alpha testing stage. Please refer to the\n\u003e [Disclaimer of Warranty section of the Apache License v2.0](https://www.apache.org/licenses/LICENSE-2.0) \n\u003e for more information on the liabilities taken on by the developer(s).\n\u003e In short, the user assumes all risks of using this software.\n\n## Installation\n\n### Binaries\nDownload the signed binaries from the [Releases\npage](https://github.com/chamilad/trash-rs/releases) and move it to somewhere\nunder the `$PATH` lookup.\n\n### Compile\n#### Prerequisites\n1. Rust (with cargo) and `x86_64-unknown-linux-gnu` toolchain\n1. [GNU `make`](https://www.gnu.org/software/make/)\n\nClone this repository and run `make all` to build the two binaries. The\nresulting binaries are in `./target/release/`.\n\n## Trashing files\n\nUse `trash` to trash files. `trash` tries to implement the same arguments as\ncoreutils `rm`, but it is not a drop in replacement for `rm`.\n\n```bash\n$ trash -h\n\ntrash version local\na freedesktop.org trash spec implementation for the CLI\n\nUsage: trash [OPTION]... [FILE]...\nMove the FILE(s) to the trash bin without unlinking\n\n    -h, --help          display this help and exit\n    -i, --interactive   prompt before every move\n    -v, --verbose       explain what is being done\n    -V, --version       output version information and exit\n\ntrash does not traverse symbolic links. It will only move the link to\ntrash bin, not the target.\n\nTo trash a file whose name starts with a '-', for example '-foo',\nuse one of these commands:\n  trash -- -foo\n\n  trash ./-foo\n\nTo restore a trashed file, any freedesktop.org trash specificaiton compatible\ntool can be used, including File Explorer in desktop environments like GNOME or\nthe TUI released with this project, \\\"Trash Bin\\\".\n\ntrash source code, documentation, and issue tracker is in Github:\n\u003chttps://github.com/chamilad/trash-rs\u003e\n\n\n$ trash somefile.txt\n```\n\n## Managing Trash Bin\n\nUse `restore`. `restore` is a TUI (Text User Interface) written using the\nawesome [`ratatui`](https://github.com/ratatui) framework to provide an\nexplorer like interface to manage trashed files including the following\nactions.\n\n1. Restore trashed files\n1. Delete a single file\n1. Empty entire trash bin\n\nPress `h` or `F1` for the keyboard shortcuts that can be used to navigate the\nUI and perform actions.\n\n```bash\nrestore\n```\n\n![UI components](./docs/restore-screen-areas.png)\n\nYou can sort the file list by,\n1. Deletion Date (default) - latest on top\n1. Original Path\n1. File Size - largest on top\n1. File Name - A-Z\n\n### Themes\nThere is limited Dark and Light theme variation in the `restore` UI. It\ndefaults to the `DARK` theme, but if you are using a light terminal theme,\n`DARK` colours will not look good. In that case, switch to `LIGHT` theme by\nsetting the environment variable `TRASH_RS_THEME` in your shell. Usually, it\nwill help if this can be permanently set in your shell configuration script\nlike `$HOME/.bashrc` or `$HOME/.zshrc`.\n\n```bash\nexport TRASH_RS_THEME=LIGHT\n```\n\n![Restore LIGHT theme on Solarized Light terminal\ncolours](./docs/restore-light-theme.png)\n\n## Highlevel Implementation Details\nThe Trash Directories used are defined in the\n[specification](https://specifications.freedesktop.org/trash-spec/latest/#trash-directories).\n\nThe specification does not enforce moving files from external mounts to home\nmount trash, and this implementation elects not to do that.\n\n\u003e The implementation MAY also support trashing files from the rest of the\n\u003e system (including other partitions, shared network resources, and removable\n\u003e devices) into the “home trash” directory.\n\nSimilary, if external mount \"top directories\" are not available for trashing,\nthis implementation elects not to trash the file at all.\n\n\u003e If both (1) and (2) fail (that is, no $topdir/.Trash directory exists, and \n\u003e an attempt to create $topdir/.Trash-$uid fails), the implementation MUST \n\u003e either trash the file into the user's “home trash” or refuse to trash it.\n\nThe `restore` UI shows trashed files from \"top directories\" with an icon to\nindicate an \"external mount\".\n\n\u003e If an implementation does NOT provide trashing in top directories, and does\n\u003e provide the user with some interface to view and/or undelete trashed files,\n\u003e it SHOULD make a “best effort” to show files trashed in top directories (by\n\u003e both methods) to the user, among other trashed files or in a clearly\n\u003e accessible separate way.\n\n![External mount icon](./docs/restore-ext-mount.png)\n\n### Details unrelated to the spec\n1. This implementation does not traverse symbolic links, i.e. trashing a\n   symbolic link only moves the link, **NOT the target**, to the trash bin. In\n   the future, this could be configurable through a command line argument. This\n   default behaviour is decided to be similar to coreutils `rm` behaviour where\n   `rm \u003clink\u003e` unlinks the link, and does not delete the target.\n\n## License\nThe source code and the release artifacts are licensed under \n[Apache License v2](https://www.apache.org/licenses/LICENSE-2.0)\n\n## Support and Contributing\nThis software is provided with absolutely no promise of support, I'm a beginner\nin Rust, and this was a pet project. Having said that, I'll probably be able to\ntend to any issues that you can report on the \"Issues\" tab. Pull Requests\nfixing bugs you find are also welcome!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamilad%2Ftrash-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchamilad%2Ftrash-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamilad%2Ftrash-rs/lists"}