An open API service indexing awesome lists of open source software.

https://github.com/datsfilipe/trxsh

Trxsh is a trash cli built in Go.
https://github.com/datsfilipe/trxsh

cli go golang linux trashcan

Last synced: 4 months ago
JSON representation

Trxsh is a trash cli built in Go.

Awesome Lists containing this project

README

          

# Trxsh

[![build](https://github.com/datsfilipe/trxsh/actions/workflows/build.yml/badge.svg)](https://github.com/datsfilipe/trxsh/actions/workflows/build.yml)

Trxsh is a simple and efficient command-line trash manager written in Go. It allows you to safely delete, list, restore, and permanently remove files from your system's trash directory.

### Table of Contents

- [Installation](#installation)
- [Features](#features)
- [Usage](#usage)
- [Trash Specification](#trash-specification)
- [License](#license)

### Installation

- Arch:

The package is now in [AUR](https://aur.archlinux.org/packages/trxsh), so to install it you can use an AUR helper like `yay`:

```bash
yay -Syu trxsh
```

or go through the process manually:

```bash
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/trxsh.git
cd yay
makepkg -si
```

- NixOS:

For now you can add a custom derivation to your NixOS config. Please refer to [derivation example](./examples/derivation.nix).

### Features

- deletion: move files to a designated trash directory instead of permanently deleting them.​
- list: biew all files currently in the trash.​
- restore: recover files from the trash by ID or using an interactive fzf interface.​
- cleanup: permanently delete files in the trash (use --days N to keep recent files).​

### Usage

```bash
Usage: trxsh [OPTIONS] [FILES]
Options:
--fzf, -f : Restore files using fzf
--list, -l : List files in trash
--restore, -r ID : Restore file by ID
--cleanup, -c : Empty trash (use --days N to keep recent files)
--dir-sizes, -s : Show directory sizes
--help, -h : Show this help
```

### Trash Specification

I've tried implementing the basics from [freedesktop.org trash specification](https://specifications.freedesktop.org/trash-spec/1.0/), but I haven't checked if eveything meets the spec. If you feel like this is an important matter, please feel free to address any issue you find with a proper PR, or to point out and I can work on that whenever I have some spare time.

### License

This project is licensed under the [MIT License](./LICENSE).