Introduction
The program nnn has a send-to-trash functionality, and it uses trash-cli. I would like to use nnn
and trash-cli
on macOS. Reading trash-cli
's homepage, I see it uses ~/.local/share/Trash/
, while macOS' Trash is ~/.Trash
.
I was thinking, I could create a symlink pointing to macOS' Trash. To test this, here is what I ran:
% cd ~/.local/share
% ln -s ~/.Trash Trash
% ls ~/.Trash
% touch deleteme
% mv deleteme Trash
% ls ~/.Trash
deleteme
So, it seems like this method works.
Testing trash-cli
Indeed, when I installed trash-cli
, the command works (with the slight drawback of using a different format):
[nix-shell:/tmp]$ touch deleteme2
[nix-shell:/tmp]$ trash deleteme2
[nix-shell:/tmp]$ tree ~/.Trash/
/Users/redacted/.Trash/
├── deleteme
├── files
│ └── deleteme2
└── info
└── deleteme2.trashinfo
2 directories, 3 files
[nix-shell:/tmp]$ trash-list
2022-04-29 15:23:37 /private/tmp/deleteme2
However, when I tried running trash-empty
, it showed that it would delete other directories:
[nix-shell:/tmp]$ trash-empty
Would empty the following trash directories:
- /Users/redacted/.local/share/Trash
- /.Trash-501
- /System/Volumes/VM/.Trash-501
- /System/Volumes/Preboot/.Trash-501
- /System/Volumes/Update/.Trash-501
- /System/Volumes/xarts/.Trash-501
- /System/Volumes/iSCPreboot/.Trash-501
- /System/Volumes/Hardware/.Trash-501
- /System/Volumes/Data/.Trash-501
- /nix/.Trash-501
- /System/Volumes/Update/mnt1/.Trash-501
Proceed? (y/n) n
I believe these are all user trashes, as my user number is 501. However, it's still a bit worrying.
My question
Is it safe to symlink .Trash
and use trash-cli
as normal?
Edit 2022-04-30
I have clarified the context (nnn) in my introduction.