Empty trash (trashes?)

Any wishes
Locked
JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Empty trash (trashes?)

Post by JayB » Wed Jan 11, 2017 5:23 pm

NC has the standard CMD-BACKSPACE for "Move to Trash", but not the standard SHIFT-CMD-BACKSPACE for "Empty Trash". Sure, you can always navigate to $HOME/.Trash, with hidden files visible, and then delete its contents, but a keyboard shortcut, a macOS standard shortcut nonetheless, would be great to have as well. Another option would be SHIFT-CTRL-CMD-BACKSPACE to force-empty the Trash, i.e. the equivalent to

Code: Select all

sudo rm -rf $HOME/.Trash/*
In admin mode, it would just remove all contents without asking; with admin mode disabled, the user would have to enter his admin password.

The question is whether all trashes would be emptied, or just the local one. I would opt for just the local .Trash directory. For other trashes, there should (if at all) be a different option, i.e. the equivalent to

Code: Select all

sudo rm -rf /Volumes/*/.Trashes/*/*
maybe SHIFT-ALT-CMD-BACKSPACE.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: Empty trash (trashes?)

Post by mike » Mon Jan 16, 2017 4:40 am

Accepted, will do in 1.2.x.

JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Re: Empty trash (trashes?)

Post by JayB » Fri Mar 10, 2017 1:06 pm

I also just noticed that CMD-BACKSPACE doesn't work on external volumes. Nimble Commander only gives you the option to permanently delete the file or cancel.

Maybe in these cases those files should be moved to the Trash folder of the external volume?

The correct path would be /Volumes/<VolumeName>/.Trashes/<uid>/<DeletedFile>

The UID is (to my knowledge) the ID (at the time of file deletion) of the user who has deleted the file, e.g. 501 for admin, 0 for root etc. Though I don't know if macOS creates these UID directories automatically. Maybe Nimble Commander would have to create them, and I don't know if that's possible with regard to permissions. (?)

JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Re: Empty trash (trashes?)

Post by JayB » Tue Feb 06, 2018 5:57 pm

This is kinda related.

I have a script now that I'm using in Nimble Commander: https://github.com/JayBrown/Silent-Trash

Part of it is that it will move files on external volumes to the .Trashes/<USERID>/ folder.

Locked