Page 1 of 1

Empty trash (trashes?)

Posted: Wed Jan 11, 2017 5:23 pm
by JayB
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.

Re: Empty trash (trashes?)

Posted: Mon Jan 16, 2017 4:40 am
by mike
Accepted, will do in 1.2.x.

Re: Empty trash (trashes?)

Posted: Fri Mar 10, 2017 1:06 pm
by JayB
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. (?)

Re: Empty trash (trashes?)

Posted: Tue Feb 06, 2018 5:57 pm
by JayB
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.