{"id":50665135,"url":"https://github.com/prettycation/trashbox.yazi","last_synced_at":"2026-06-08T05:32:27.201Z","repository":{"id":353726212,"uuid":"1220661671","full_name":"prettycation/trashbox.yazi","owner":"prettycation","description":"A Yazi plugin for browsing and managing Trash / Recycle Bin directly from the main file manager UI.","archived":false,"fork":false,"pushed_at":"2026-04-25T07:41:26.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-25T09:22:13.618Z","etag":null,"topics":["lua","plugin","python","trashy","yazi","yazi-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettycation.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T06:55:32.000Z","updated_at":"2026-04-25T07:41:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prettycation/trashbox.yazi","commit_stats":null,"previous_names":["prettycation/trashbox.yazi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/prettycation/trashbox.yazi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettycation%2Ftrashbox.yazi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettycation%2Ftrashbox.yazi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettycation%2Ftrashbox.yazi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettycation%2Ftrashbox.yazi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettycation","download_url":"https://codeload.github.com/prettycation/trashbox.yazi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettycation%2Ftrashbox.yazi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34050224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["lua","plugin","python","trashy","yazi","yazi-plugin"],"created_at":"2026-06-08T05:32:27.138Z","updated_at":"2026-06-08T05:32:27.188Z","avatar_url":"https://github.com/prettycation.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trashbox.yazi\n\n[简体中文](./README.zh-CN.md)\n\nA Yazi plugin for browsing and managing Trash / Recycle Bin directly from the main file manager UI.\n\nSupported actions include:\n\n- open Trash\n- restore selected items\n- permanently delete selected items\n- empty all Trash\n- empty items older than a given number of days\n\n## Features\n\n- Browse Trash directly in the Yazi main view\n- Linux support via the real FreeDesktop Trash `files/` directory\n- Windows support via aggregated per-volume Recycle Bin views\n- Restore / delete / empty / empty-by-days actions\n- Real-content preview support:\n  - Linux: directly opens the real trash content directory\n  - Windows: builds a merged view from per-volume Recycle Bin entries\n- View names prefer original names, and only add suffixes on conflicts\n\n## Platform Behavior\n\n### Linux\n\nOn Linux, `trashbox.yazi` opens the real Trash content directory directly:\n\n- Trash files are browsed from the actual `files/` directory\n- restore and delete operations are resolved through the matching `.trashinfo` metadata\n\nThis means preview works naturally because Yazi is looking at the real trashed files.\n\n### Windows\n\nWindows Recycle Bin is not stored as one single global directory.\n\nEach volume has its own Recycle Bin storage, so `trashbox.yazi` aggregates entries across available drives into a unified view.\n\nThis lets you browse Trash from one place inside Yazi.\n\n## Requirements\n\n- [Yazi](https://github.com/sxyazi/yazi)\n- Python 3 available in `PATH`\n- [`trashy`](https://github.com/oberblastmeister/trashy) available in `PATH`\n\n## Installation\n\n```sh\nya pkg add prettycation/trashbox\n```\n\n## Configuration\n\nAdd this to your Yazi `init.lua`:\n\n```lua\nrequire(\"trashbox\"):setup({\n confirm_restore = true,\n confirm_delete = true,\n confirm_empty = true,\n})\n```\n\n## Path Resolution\n\nPlugin directory resolution order:\n\n1. `YAZI_CONFIG_HOME`\n2. Windows fallback: `%APPDATA%\\yazi\\config`\n3. Other platforms fallback: `~/.config/yazi`\n\nThe adapter runtime data uses XDG-style directories:\n\n- cache: `XDG_CACHE_HOME` or `~/.cache`\n- state: `XDG_STATE_HOME` or `~/.local/state`\n\n## Keybindings\n\n### Recommended: Preset\n\nAdd this to your `~/.config/yazi/keymap.toml`:\n\n```toml\n[mgr]\nprepend_keymap = [\n  { on = [\"R\",\"t\"], run = \"plugin trashbox\", desc = \"Open Trash menu\" },\n]\n```\n\n`R t` opens a menu that provides access to all Trash management functions:\n\n- `o` → Open Trash\n- `r` → Restore from Trash\n- `d` → Delete from Trash\n- `e` → Empty Trash\n- `D` → Empty by Days\n\n\u003e Tip\n\u003e\n\u003e `trashbox.yazi` uses the array form for its keymap example.\n\u003e You must pick only one style per file; mixing with `[[mgr.prepend_keymap]]` will fail.\n\u003e\n\u003e Also note: some plugins may suggest binding a bare key like `on = \"R\"`, which blocks all `R \u003ckey\u003e` chords, including `R t`.\n\u003e Change those to chords such as `[\"R\",\"r\"]`, or choose a different non-conflicting prefix.\n\n### Alternative: Custom Direct Keybinds\n\nIf you prefer direct keybinds, you can configure them like this:\n\n```toml\n[mgr]\nprepend_keymap = [\n  { on = [\"R\",\"o\"], run = \"plugin trashbox -- open\",      desc = \"Open Trash\" },\n  { on = [\"R\",\"e\"], run = \"plugin trashbox -- empty\",     desc = \"Empty Trash\" },\n  { on = [\"R\",\"D\"], run = \"plugin trashbox -- emptyDays\", desc = \"Empty by days deleted\" },\n  { on = [\"R\",\"d\"], run = \"plugin trashbox -- delete\",    desc = \"Delete from Trash\" },\n  { on = [\"R\",\"r\"], run = \"plugin trashbox -- restore\",   desc = \"Restore from Trash\" },\n]\n```\n\n## Commands\n\n### `plugin trashbox`\n\nOpen the plugin action menu.\n\n### `plugin trashbox -- open`\n\nOpen Trash in the Yazi main view.\n\n- Linux: opens the real Trash content directory\n- Windows: opens the aggregated Recycle Bin view\n\n### `plugin trashbox -- put`\n\nMove the selected or hovered file(s) to Trash.\n\n### `plugin trashbox -- restore`\n\nRestore the selected item(s) from the current Trash view.\n\n### `plugin trashbox -- delete`\n\nPermanently delete the selected item(s) from the current Trash view.\n\n### `plugin trashbox -- empty`\n\nEmpty all Trash contents.\n\n### `plugin trashbox -- emptyDays`\n\nDelete Trash items older than a specified number of days.\n\nThe default prompt value is `30`.\n\n## How It Works\n\n### Linux\n\n`trashbox.yazi` works directly against the real Trash structure:\n\n- `files/`\n- `info/`\n\nThe plugin opens the real content directory in Yazi, so preview and file inspection work naturally.\n\n### Windows\n\n`trashbox.yazi` scans per-volume Recycle Bin storage and builds a merged view for Yazi.\n\nImportant details:\n\n- Recycle Bin entries are aggregated across available drives\n- display names prefer the original filename\n- if names conflict, suffixes such as `[2]`, `[3]`, etc. are added\n- the merged view is rebuilt automatically when refreshed\n\n## Notes\n\n- On Windows, refresh creates a new view directory to avoid directory-lock issues when Yazi is currently inside the old view.\n- On Linux, restore and delete rely on matching `.trashinfo` metadata.\n- On Windows, restore and delete rely on aggregated view mapping and Recycle Bin metadata.\n- If preview does not work for a specific item, it usually means the current environment could not materialize that entry into a previewable target safely.\n\n## Troubleshooting\n\n### `adapter not found or not runnable`\n\nMake sure:\n\n- the plugin is installed correctly\n- Python is available in `PATH`\n- `trashy` is available in `PATH`\n\n### `trashy executable not found in PATH`\n\nInstall `trashy` and make sure it is accessible from your shell.\n\n### Refresh fails on Windows\n\nOlder generated views may still be in use by another process.\n\nThe plugin avoids deleting the currently-open view by generating a fresh view directory during refresh.\n\n### Weird names in Windows Trash view\n\nThis usually indicates problematic or incomplete Recycle Bin metadata parsing.\n\nThe current adapter prefers the original filename when possible and falls back more conservatively.\n\n## Acknowledgements\n\nThis plugin draws design inspiration from [`recycle-bin.yazi`](https://github.com/uhs-robert/recycle-bin.yazi), especially in:\n\n- keeping Trash operations inside the Yazi main UI as much as possible\n- exposing the core action set of `open / restore / delete / empty / emptyDays`\n- following a Yazi-friendly keybinding workflow\n\nAt the same time, this plugin uses a different backend implementation path in order to support Windows + Linux.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettycation%2Ftrashbox.yazi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettycation%2Ftrashbox.yazi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettycation%2Ftrashbox.yazi/lists"}