Tuesday

Xfce Recycle Bin workaround in four easy steps.

The new Xfce desktop is rather cool. The latest release include Thunar, a fast and light (and downright sexy) file manager. But Xfce and Thunar are not exactly perfect. One of the things I do miss is a trash or recycle bin. In the current thunar, when you delete a file, it is gone for good. Here's what I did to work around that.

Step 1: Create a folder for your trash. This can be anywhere that you have write access. I put mine in my home folder. For the purposes of this tutorial I will call the home folder "mine". You should replace "mine" with the name of your own home folder. So, create a folder called ".trash" in "/home/mine/". Now you should have a "/home/mine/.trash" folder.

Step 2: Now, in Thunar, click on Edit in the menu bar. Towards the end of the menu, click on "Configure custom actions". The custom actions window will probably have at least one entry, probably the "Open Terminal Here" action. Click on the plus sign on the right-hand side of the window. You will get the create action window. Under name, I typed "Trash". You may want to call it "move to trash" or something similar. For Command, type mv %n /home/mine/.trash/%n If you want an icon, click on the box that says "no icon" and choose an icon. Click on the "appearance Conditions" tab at top. You want an asterisk (*) for File pattern and go ahead and check all of the boxes in the window. Click on Ok in the Create Action window, and Close on the Custom Action window. Now when you right-click on a single file or folder, you should have an entry that says "Trash" and clicking on trash should move the file to "/home/mine/.trash"

Step 3: Like I said, this will only work on a single file. So for moving multiple files I need another solution. What I did was add an entry to the shortcuts sidebar for the .trash folder. If you have thunar open to your home folder, click on "View" on the menubar. About half way down the menu there should be an entry that says "Show Hidden Files". Click on that and there should be several folders now with names that start with a period. Scroll down until you find the ".trash" folder. Right-click on the .trash folder and left-click on "Add Folder to Shortcuts" on the menu. Now you should be able to select multiple files and folders and drag them to the .trash folder on the sidebar. If you want, you can rename the shortcut on the sidebar. I renamed mine to "trash"

Step 4: Ok, so now we can send files to the trash, but I've come to expect at least a little more functionality from my trash bin. So, the final step for my weak recycle bin replacement is to add a trash bin link to the task bar. Right-click on the bar and choose "Add New Item". In the "Add Items to the Panel" window, click on "Launcher" and click the "Add" button. Now you should be in the "Properties" window. For "Name" type "Trash", Choose an icon if you want, and for "Command" type thunar /home/mine/.trash This will open thunar to your .trash folder. Now, Look for the plus icon on the bottom left hand side of the Properties window. Click on that an you should have "New item" in the list above. For "Name" type "Empty Trash", Choose an icon if you want, and for "Command" type rm /home/mine/.trash/* Now check the box that says "Run in terminal" and click on close. You should now have an icon for trash, and an arrow that opens a menu with "Empty Trash". This will delete the contents of the .trash folder, so use it with caution.

Well. that, sadly is it. It is far from a complete solution. Most notably, pressing delete on the keyboard will still permanently delete a file. But without figuring out how to remap the delete key, this is all I've got. Much Love.