Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Add a trash can to the desktop Desktop
If you want to add a Trash Can to your desktop, the following works in Panther.

The .Trash file is hidden so you need to find it somehow; I used WhatSize to locate the folder and double clicked to open it. Drag the .Trash folder to the sidebar of your Finder. Now create a new folder on your desktop, and then create an alias of the brand new folder. Do a "Get info" on the alias folder and click on "Select New Original" and select the .Trash folder on the Finder sidebar. Job done!

Now delete the original folder created on your desktop, and rename and give a swanky new icon to the alias folder.

[robg adds: An easy way to get to the .Trash folder is to hit Shift-Command-G (Go to Folder) and then type /Users/your_username/.Trash and hit return; this should open the trash folder for your user in a Finder window. Personally, I just use Command-Delete so I don't miss the desktop trash in the least, but I've had a few requests for a Panther-compatible trash on desktop hack, so here's one solution.]
    •    
  • Currently 2.00 / 5
  You rated: 4 / 5 (7 votes cast)
 
[33,239 views]  

10.3: Add a trash can to the desktop | 13 comments | Create New Account
Click here to return to the '10.3: Add a trash can to the desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Add a trash can to the desktop
Authored by: acalado on Jan 14, '04 11:26:04AM

A shortcut to typing "/Users/your_username/.Trash" would be "~/.Trash". In unix speak, "~" indicates the current user's home folder. Saves a few keystrokes...

Andy



[ Reply to This | # ]
10.3: Add a trash can to the desktop
Authored by: kikjou on Jan 14, '04 11:44:24AM

Remember that, depending on where you Trash files from, they may end up in different .Trash folders. Mounted disks, for instance, have their own .Trash folders. The solution discussed above will therefore not show you all trashed files.



[ Reply to This | # ]
Quicker in Terminal
Authored by: jecwobble on Jan 14, '04 11:55:12AM

I'm not at my Mac to test this, and I'm certainly no UNIX guru, but I would think the following would give you what you want more quickly:

ln -s ~/.Trash ~/Desktop/Trash

It's a symlink and not an alias, but that may be better or worse, I suppose.

Personally, I'm with Rob- I use Command-Delete to trash things and Command-E to eject. My Dock is hidden and almost never used, especially not for these two operations.



[ Reply to This | # ]
Quicker in Terminal
Authored by: metiure on Jan 14, '04 01:42:43PM

it works the way you say :)

vic



[ Reply to This | # ]
Quicker in Terminal
Authored by: willjwade on Jan 14, '04 02:22:09PM

Does work but you wont be able to change the icon. No idea why..



[ Reply to This | # ]
Quicker in Terminal
Authored by: hysterion on Jan 15, '04 05:24:19AM
It's because the icon goes in the resource fork, which BSD aliases don't have.
To get a Mac alias from the command line, use this method:
localhost:~ fz$ python -c """from macostools import *
> mkalias('.Trash','Desktop/MacAlias')"""
You may then glue the Trash icon onto the alias as explained here,
and check that it all goes into the rsrc fork:
localhost:~ fz$ ls -l Desktop/MacAlias/..namedfork/data Desktop/MacAlias/..namedfork/rsrc
-rw-r--r--  1 fz  fz      0 15 Jan 11:06 Desktop/MacAlias/..namedfork/data
-rw-r--r--  1 fz  fz  54099 15 Jan 11:06 Desktop/MacAlias/..namedfork/rsrc
In contrast ln -s .Trash Desktop/BSDAlias gives a regular file without rsrc fork:
localhost:~ fz$ ls -l Desktop/BSDAlias Desktop/BSDAlias/..namedfork/rsrc
lrwxr-xr-x  1 fz  fz  6 15 Jan 11:10 Desktop/BSDAlias -> .Trash
ls: Desktop/BSDAlias/..namedfork/rsrc: No such file or directory


[ Reply to This | # ]
Quicker in Terminal
Authored by: hysterion on Jan 15, '04 05:37:29AM
P.S. This yoga also lets you actually view what's inside the Mac alias resource fork (here, before gluing the icon):
localhost:~ fz$ hexdump -C Desktop/MacAlias/..namedfork/rsrc
00000000  00 00 01 00 00 00 01 d6  00 00 00 d6 00 00 00 32  |...............2|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000100  00 00 00 d2 00 00 00 00  00 d2 00 02 00 01 04 48  |...............H|
00000110  6f 6d 65 00 00 00 00 00  00 00 00 00 00 00 00 00  |ome.............|
00000120  00 00 00 00 00 00 00 00  00 00 bb d0 8a 36 48 2b  |.............6H+|
00000130  00 00 00 00 00 15 06 2e  54 72 61 73 68 00 00 00  |........Trash...|
00000140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000170  00 00 00 00 00 00 00 00  00 1b bb d0 69 77 00 00  |............iw..|
00000180  00 00 00 00 00 00 ff ff  ff ff 00 00 09 00 00 00  |................|
00000190  00 00 00 00 00 00 00 00  00 00 00 10 00 08 00 00  |................|
000001a0  bb d0 d0 86 00 00 00 11  00 08 00 00 bb d0 af c7  |................|
000001b0  00 00 00 0e 00 0e 00 06  00 2e 00 54 00 72 00 61  |...........T.r.a|
000001c0  00 73 00 68 00 0f 00 0a  00 04 00 48 00 6f 00 6d  |.s.h.......H.o.m|
000001d0  00 65 ff ff 00 00 00 00  01 00 00 00 01 d6 00 00  |.e..............|
000001e0  00 d6 00 00 00 32 00 20  a0 8c 00 0e 00 00 00 1c  |.....2. ........|
000001f0  00 32 00 00 61 6c 69 73  00 00 00 0a 00 00 ff ff  |.2..alis........|
00000200  00 00 00 00 00 20 a0 9c                           |..... ..|
00000208


[ Reply to This | # ]
10.3: Add a trash can to the desktop
Authored by: zeusr on Jan 14, '04 12:45:29PM
The trashes for the user's own home directory trash is stored in '~/.Trash', but for every item that originates on a different volume, the item is moved to '/Volumes/VolumeName/.Trashes/UserID#/'.

This hint will only show the items in the '~/.Trash' directory, and no, I haven't figured out how to get a desktop Trashcan that access all Volumes' trash files for that user, without using a special program for that purpose...

[ Reply to This | # ]

10.3: Add a trash can to the desktop
Authored by: googoo on Jan 14, '04 02:29:36PM

I have not done it (I like <cmd><delete>), but you could write an AppleScript application that would trash any file dropped upon it instead using of a symlink or alias. You could even give the script a custom icon! I do not know how to change the icon when the trash is not empty (although I bet it can be done)!

-Mark



[ Reply to This | # ]
10.3: Add a trash can to the desktop
Authored by: googoo on Jan 14, '04 02:43:40PM

OK. Here is the AppleScript.


on open these_items
  tell application "Finder" to delete these_items
end open
Save it as an AppleScript Application and put it where you want (i.e., on the Desktop). I will leave the custom icon as an exercise for the reader!

-Mark

[ Reply to This | # ]

10.3: Add a trash can to the desktop
Authored by: tyip on Jan 14, '04 05:36:02PM

What I've done is use one of the dock control utilities to position the dock on the bottom right of the screen so that the trash can is always at the bottom right, no matter what else is in the dock. (You need a utility to put the dock at anything other than center position.)

While this doesn't allow you to move the trash can around, it does put it in the traditional position at the bottom right, which is where I want it.



[ Reply to This | # ]
Here's a free trashcan
Authored by: wgscott on Jan 14, '04 06:06:45PM
This one works and is free: http://www2s.biglobe.ne.jp/%7Ekyanagi/mac/en/trash14.sit The only drawback is it doesn't show stuff inside, but is otherwise fully functional.

[ Reply to This | # ]
Here's a free trashcan
Authored by: ken22 on Feb 08, '04 02:42:02PM

There is an application to do this. Go to http://www.kanzu.com and look at iCan.



[ Reply to This | # ]