Posts: 1,028
SamK
Joined: 21 Aug 2011
#1
Many users have become accustomed to working with a Tashcan (known in Windows as Recycle Bin). antiX ships without one. While is is not an essential tool, having one can provide some comfort and reassurance.

The following shows how to add a trashcan to the default setup provided by antiX-Full. According to its author it"complies with the freedesktop-trash-spec", so should work OK with any other you may have been trialing that also conforms to the same spec.

The original post has been amended. The following sections describe how to set up Trashcan to work seamlessly and interchangeably when using either ROX-Filer (the default file manager for antiX) or SpaceFM. They both use the same Trashcan. In step-by-step form, it covers:
  1. Getting the files,
  2. Installing Trashcan,
  3. Setting up items in the menus of ROX-Filer and SpaceFM,
  4. Putting Trashcan on the desktop,




GETTING THE FILES
All the required files are contained in trashcan-antix.zip. A link to the file is at the foot of this post. Download it to the root of your home directory (folder).

Extract the contents of the zip archive
  1. Open Archive Manager (File-Roller)
  2. Select trashcan-antix.zip-->Click Open
  3. Archive-->Extract
  4. Select your home directory-->Click Extract
    Note: It is important to select the root of your home directory rather than a sub-directory
Your home folder will now contain five further files:
trashcan-bin.zip, trashcan-rox-links.zip, trashcan-rox-scripts.zip, trashcan-spacefm-menuitems.tgz, trashcan-spacefm-deletkeytotrashcan.tgz



TRASHCAN
trashcan-bin.zip contains the trashcan executable files. Unzipping this file automatically places them in a hidden directory (folder) within your home directory (.local/bin/Trashcan).

Set up Trashcan
  1. Open Archive Manager (File-Roller)
  2. Select trashcan-bin.zip-->Click Open
  3. Archive-->Extract
  4. Select your home directory-->Click Extract
    Note: It is important to select the root of your home directory (folder) rather than a sub-directory
To see the newly created hidden directory switch your file manager to show hidden files and look in your home directory for .local/bin which now contains Trashcan.



ROX-FILER
Setting up Trashcan within Rox is done in three steps, creating some scripts, creating some menu items, then assigning icons to them.

Create the scripts
Do this step as root. It will create three files, trashcan-empty.sh, trashcan-restore-all.sh, trashcan-view.sh
  1. Open Archive Manager (File-Roller)
  2. Select trashcan-rox-scripts.zip-->Click Open
  3. Archive-->Extract
  4. File System-->usr-->local-->bin-->Click Extract
Create the menu items
Do this step as your normal user. It will automatically create a link to Trashcan in your home directory (folder) and items in the right-click-->Send To menu of ROX.
  1. Open Archive Manager (File-Roller)
  2. Select trashcan-rox-links.zip-->Click Open
  3. Archive-->Extract
  4. Select your home directory-->Click Extract
    Note: It is important to select the root of your home directory rather than a sub-directory
To see the new menu entries, open a ROX-Filer window. Right-click on a file-->Send To-->Trashcan.

Assign icons to the menu items
Do this step as your normal user in ROX-Filer. It is easier to do with two open ROX windows. Both of them are hidden directories with your home directory (folder).
Tip: Click on the eye icon in ROX to show hidden files.
  1. Open a window .local-->bin
  2. Right-click Trashcan-->Look Inside
  3. Open a window .config-->rox.sourceforge.net-->SendTo-->Trashcan
  4. Right-click-->Empty Trashcan-->right-click-->Set Icon
  5. Select radio button"Only for the file..."
  6. Drag-and-drop trash-full.png into the Set icon window
  7. Repeat steps 4 to 6 inclusive for Restore All Trash and View Trash


SPACEFM
Setting up Trashcan within SpaceFM is done in two stages, creating items in the right-click menu, and an optional step of changing the keyboard delete key to point to Trashcan. Do the stages in SpaceFM as your normal user.

If you use only SpaceFM to manage your files and also set up Trashcan for ROX-Filer, there will be a redundant link named Trashcan in your home folder. This may safely be deleted as it is not used in SpaceFM.

Create the menu items
  1. Plugins-->Copy-->File
  2. Select trashcan-spacefm-menuitems.tgz-->Click OK
  3. Close the Copy Plugin dialog box that opens
  4. In the main panel (lists both files and directories) right-click on white space
  5. In the box that opens move the cursor over any active item (e.g. Go)
  6. Right-click again on the active item to close its pop-up menu
  7. Right-click again on the active item to open a further pop-up menu
  8. In the pop-up menu-->Click Paste
To show the Trashcan sub-menu, right-click on white space in the main panel. It will contain items Add to Trashcan, Empty Trashcan, Restore All Trash, View Trash.

OPTIONAL STEPS RELATED TO THE KEYBOARD KEYS
Change the action of the delete key on the keyboard
Assign a key combination to the delete key
  1. In the main panel-->right-click on a file or directory
  2. In the pop-up menu-->right-click Delete-->left-click Key
  3. On the keyboard, press CTRL (hold it down) and press Delete
  4. In the Set Key window-->Click Set
To permanently delete a file or directory via the keyboard, press the CTRL+Delete keys.

Assign Trashcan to the delete key
  1. Plugins-->Copy-->File
  2. Select trashcan-spacefm-deletekeytotrashcan.tgz-->Click OK
  3. Close the Copy Plugin dialog box that opens
  4. In the main panel right-click on white space
  5. In the box that opens move the cursor over any active item (e.g. Go)
  6. Right-click again on the active item to close its pop-up menu
  7. Right-click again on the active item to open a further pop-up menu
  8. In the pop-up menu-->Click Paste
  9. In the main panel right-click on white space
  10. In the pop-up menu-->right-click Add To Trashcan-->left-click Key
  11. On the keyboard, press Delete
  12. In the Set Key window-->Click Set
To send a file or directory to Trashcan via the keboard, press the Delete key.



TRASHCAN ON THE DESKTOP
To have Trashcan displayed on the desktop, your system must be running ROX Pinboard. This is the default for antiX as shipped. ROX Pinboard manages the icons on your desktop. Using any other application to do this (including SpaceFM) will prevent Trashcan from working on the desktop.

Place Trashcan on the desktop
Tip: Click on the eye icon in ROX to show hidden files.
  1. Open a ROX-Filer window in your home directory to show the hidden directory .local-->bin
  2. Drag-and-Drop the Trashcan icon to your desktop
Drag-and-drop files to the desktop icon to add them to Trashcan.
Right-click the the desktop icon to empty or restore all trash.
Left-click the the desktop icon to view trash. In this window a right-click on a single file enables it to be restored or permanently deleted.



Screen shot of the end result.
ROX-Filer and SpaceFM showing Trashcan on right-click menus. Trashcan also placed on antiX desktop.
ROX-Filer and SpaceFM showing Trashcan on right-click menus. Trashcan also placed on antiX desktop.



Aknowledgement: dolphin_oracle
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#2
Nice write up and packaging of the required pieces!

FYI, the file trashcan-spacefm-menuitems.tgz also works as a spacefm plugin (plugin>install>file). This will add the menus to the plugin menu. Spacefm also lets you copy a command by right-clicking over the command in any menu, selecting copy, and then pasteing into another menu as per the procedure above.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#3
antiX ships without one
If it shipped with one, could that feature be toggled to a disabled state?
I expect few users are up to the chore of"DIY add a trash in 164 easy steps"
Posts: 19
pcpavnz
Joined: 09 Nov 2012
#4
SamK wrote: SPACEFM
Setting up Trashcan within SpaceFM is done in two stages, creating items in the right-click menu, and an optional step of changing the keyboard delete key to point to Trashcan. Do the stages in SpaceFM as your normal user.

If you use only SpaceFM to manage your files and also set up Trashcan for ROX-Filer, there will be a redundant link named Trashcan in your home folder. This may safely be deleted as it is not used in SpaceFM.

Create the menu items
  1. Plugins-->Copy-->File
  2. Select trashcan-spacefm-menuitems.tgz-->Click OK
  3. Close the Copy Plugin dialog box that opens
  4. In the main panel (lists both files and directories) right-click on white space
  5. In the box that opens move the cursor over any active item (e.g. Go)
  6. Right-click again on the active item to close its pop-up menu
  7. Right-click again on the active item to open a further pop-up menu
  8. In the pop-up menu-->Click Paste
To show the Trashcan sub-menu, right-click on white space in the main panel. It will contain items Add to Trashcan, Empty Trashcan, Restore All Trash, View Trash.
I had to do the right click thing 3 times before the additional popup menu would come up, and to confirm it, I repeated the right click process step twice, the first time I didn't follow through, so for me, that makes 3 right clicks in a row.