Skip navigation.

Trash / recycle bin / undelete feature

Instead of asking users whether they really want to delete something irreversably, we should simply move it to a trash directory and offer the user the chance to undo the action if it was a mistake.

Perhaps we can use The Trash specification?

Trash Can for Rox

I have written a "Trash Can" program for Puppy Linux. Since Puppy uses Rox it shouldn't be too hard to adapt it to work in any Linux distribution. I am still refining it for the next release of Puppy which is 1.0.9, but it has been included in the last few versions of Puppy. What would really help me is some more knowledge of Rox and how to modify the desktop icons on the pinboard.

Pinboard RPC

Do you have a link for the trash can? Also, does it support the freedesktop trash system?

The pinboard can be controlled using RPC calls. See appendix C of the manual.

If you have any questions about the pinboard, you can ask on the mailing lists.


Puppy's Trash

To tell the truth I had never heard of the freedesktop trash specifications when I wrote Puppy's Trash. I have since read the freedesktop trash specifications and while mine does not currently follow them, it looks like it would be fairly easy to make it so. Puppy is a live CD and runs as root so much of the freedesktop trash specifications did not apply when I wrote it, but I wrote it with many of the same goals. The Trash application is a RoxApp. The current version can be downloaded from here:
Just change the file extension from .pup to .zip to extract it. You can also download the latest copy of Puppy to see how it works in that environment.

For the next version of the Trash I am trying to use your suggestion of the RPC calls to update the desktop when someone removes a file that has a Pinboard icon referencing it. I am also working to add a "restore" feature.

New version of Trash

I uploaded a test version of the new Trash. I have started to conform it to the freedesktop trash specifications.

Problems in latest Trash app

I tried to use the latest version of your trash but I bumped into two problems.

The first is that the application is meant for a user working as root, whereas you can be working as any user. I solved this problem by replacing /root/ with ~/ which should conform to whatever the user is working as.

Secondly, and I didn't go as far as changing anything for this one, there is a part of the code that pertains solely to Puppy Linux and I suppose that this is why when I drag an item to the trash can, it doesn't delete the item or move it to the trash. In fact, it just does nothing. There may be something conflicting in the code, but I hadn't been able to take a deep look at it.

Also, you mention that instead of asking users whether they really want to delete something irreversibly, we should simply move it to a trash directory and offer the user the chance to undo the action if it was a mistake. This is awesome because in my more than a year experience with Rox, I managed to delete some files irreversibly by mistake. However, I still don't get whether the idea is just to trash the files when moving them to the trash or evey time one performs the delete action on a file or group of files.

Universal Trash

The main reason that there is "Puppy specific" code in there is because Puppy's default version of Rox is 1.2 which does not support SOAP. This means that I have to edit the Pinboard manually. I will try to make a more universal trash and forgo the support for older versions of Rox. The universal version should run as any user in any Linux, Puppy included as long as Rox supports SOAP. Once it is done I will post a link to it. Thanks for the feed back.

Modified Puppy Trash

Well, the reason of my post is becouse i made a modification of this trashcan. The changes i made are:

- Replaced gxmessage/xmessage for zenity.
- Removed the item "Quickly Empty the Trash"
- Added a new sound for "Restore item" operation.
- Added a new confirmation dialog for remove operation.
- Replace "root" directory by $HOME to adapt to any user.
- Replace "/root/Choices/ROX-Filer/puppypin" by "$HOME/.config/" to adapt an any distribution, user, and actual Rox-Filer Versions.
- Replace play.tcl in "PlaySound" function by "aplay"
- Corrected a bug with items with spaces on their names.

Well, you can download here: trashcan-0.1.tar.bz2

And i made a mini page here: Mini-Page

Ok, still have i bug. Test and i wait your posts...


My english is creepy, i know :P

New Version


- Replaced "Original File Location" operation with "Item info", now show the original location and the deletion date.
- IMPORTANT! Corrected bug appearing if de path of the trashcan contain some folder with a space on this name.
- Check if zenity is installed, if not prompt a info dialog with xmessage. If xmessage is not installed, an "echo" prompt is displayed.


Mini Page


Version 0.1.3


- Added "Restore all" operation.
- Added a new sound for "delete" operation.
- Improved some code about the sounds operations (Thanks Dan Van Wormer).
- Improved the "Item info" operation, now info is stores in a single file "filename.trashinfo" (According to the Trash specification).
- Created two subdirectories in the removed file app directory, "files" where deleted item(s) is stored and "info" where the info file is stored (According to the Trash specification).
- Replaced "aplay" command with "play".



Web page

If you want a page on this site for it (rather than putting comments here), feel free to create one (register, then choose create content from the panel on the left)...


Ok, i did it. Thanks Thomas :)

Syndicate content