Trash for Ice
Trash for Ice
I don't know if anybody would be interested, but here is a little script that I wrote for Ice, that creates a "Trash" can on the desktop. It could easily be made to work in other window managers though. It is manual intallation only at the time. I got the trash icons from Knoppix. Here is a screen shot of how it looks.
EDIT
In the README file I forgot to mention that you need to create a symlink of /root/my-applications/bin/empty-trash and place it in /usr/local/bin
I fixed it.
EDIT File removed. Download final copy here
EDIT
In the README file I forgot to mention that you need to create a symlink of /root/my-applications/bin/empty-trash and place it in /usr/local/bin
I fixed it.
EDIT File removed. Download final copy here
Last edited by dvw86 on Mon 20 Feb 2006, 02:54, edited 4 times in total.
- papaschtroumpf
- Posts: 250
- Joined: Fri 17 Jun 2005, 04:23
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
I did miss having a bin - so now I have one - good stuff. I notice that Puppy or is it Linux takes several seconds to delete files (applies to copying aswell)dvw86 wrote:That would be great since I have a bunch of png's that I want to use in the Ice menu. I'll give it a try.GuestToo wrote:the png might work in the menu too ... icewm can display pngs's and will automatically resize them too
Is this mounting, compressing and uncompressing? Why is it slow? Can it be speeded up or tell me it is doing it?
thanks again
It is not slow on my system. It is pretty instantaneous, although Rox doesn't update until after you mouse over the Rox window. It's just a simple script (my first shell script btw). It just checks to see if you have included a file or directory when activating the script. If there is a file or directory it moves it to the trash. If no file or directory it simply opens up the trash file in Rox.
The empty trash script just deletes everything in the trash directory.
Code: Select all
#!/bin/sh
test -sd "$@"
if [ "$?" = "0" ]
then
exec rox /root/.Trash
else mv "$@" /root/.Trash/
fi
Code: Select all
#!/bin/sh
rm -r /root/.Trash/*
- papaschtroumpf
- Posts: 250
- Joined: Fri 17 Jun 2005, 04:23
- papaschtroumpf
- Posts: 250
- Joined: Fri 17 Jun 2005, 04:23
Have you even tried it? grab a file from rox-filer and drag it onto the icon and it goes to the trash, just like you'd expect.
SendTo is not working for me yet but it should work, I must have screwed up somewhere. (EDIT: I had and it now works)
Anyone knows of a clever way that you could get the "empty trahscan" choice if you right click on the trashcan rather than use the quicklaunch?
By the way, I did verify that if you put the png icon in the icewm path, and specify the png extension in the quicklaunch menu (the toolbar file), it gets dispayed properly and gets resized. Minor savins, but everything counts.
As part of adding this to an unleashed, I think the following paths make sense:
scripts in /usr/X11R6/bin
png icon in /usr/local/share/icewm/icons
modify toolabr file in /usr/local/share/icewm/toolbar
ln -s /usr/X11R6/bin/empty-trash /usr/local/bin/empty-trash
ln -s /usr/X11R6/bin/Trash /root/Choices/SendTo/Trash
SendTo is not working for me yet but it should work, I must have screwed up somewhere. (EDIT: I had and it now works)
Anyone knows of a clever way that you could get the "empty trahscan" choice if you right click on the trashcan rather than use the quicklaunch?
By the way, I did verify that if you put the png icon in the icewm path, and specify the png extension in the quicklaunch menu (the toolbar file), it gets dispayed properly and gets resized. Minor savins, but everything counts.
As part of adding this to an unleashed, I think the following paths make sense:
scripts in /usr/X11R6/bin
png icon in /usr/local/share/icewm/icons
modify toolabr file in /usr/local/share/icewm/toolbar
ln -s /usr/X11R6/bin/empty-trash /usr/local/bin/empty-trash
ln -s /usr/X11R6/bin/Trash /root/Choices/SendTo/Trash
Mandriva LE 2005 user and puppy newbie
it's trivially easy to add Empty Trash to the context menu of the trash icon, if you make it a roxapp
the roxapp will have the icon in it too
you can run a roxapp from a menu, and link to the icon inside it (or the icon inside it can be a symlink if you like)
see my aterm dotpup (or aumix or eboard or mplayer or xmms) to see how to add context menus to a roxapp (right click the icon and click Look Inside ... the context menu is in AppInfo.xml ) ... and read the rox docs
the roxapp will have the icon in it too
you can run a roxapp from a menu, and link to the icon inside it (or the icon inside it can be a symlink if you like)
see my aterm dotpup (or aumix or eboard or mplayer or xmms) to see how to add context menus to a roxapp (right click the icon and click Look Inside ... the context menu is in AppInfo.xml ) ... and read the rox docs
Great ideas. I'll work on a context menu for the trash can.
I was trying to keep as much of it in root as possible so it will not get deleted with Puppy upgrades, but you can stick things in any directory that you want. I'm glad that some one finds it useful.I think the following paths make sense:
scripts in /usr/X11R6/bin
png icon in /usr/local/share/icewm/icons
modify toolabr file in /usr/local/share/icewm/toolbar
ln -s /usr/X11R6/bin/empty-trash /usr/local/bin/empty-trash
ln -s /usr/X11R6/bin/Trash /root/Choices/SendTo/Trash
Ok, here it is. This is a Rox App version of Trash. I did not include the IceWM Quick Launch Menu or the empty-trash script since you can now right click on the trash icon and select "Empty the Trash". Just unzip it, put it where you want, and drag it to your desktop. I will also make a zip file of the icons and the empty-trash script for those who may want them. Only one icon is included and it sets itself. Thanks to GuestToo for his words of wisdom.
EDIT You will also need to create /root/.Trash if you do not already have it.
EDIT #2 File removed. Download final copy here
EDIT You will also need to create /root/.Trash if you do not already have it.
EDIT #2 File removed. Download final copy here
Last edited by dvw86 on Tue 19 Jul 2005, 00:09, edited 2 times in total.
This is basically the things I took out of the first zip file. You can use them to make an "Empty the Trash" item in the Quick Launch Menu if you do not already have it.
- Attachments
-
- trash-extras.zip
- Extra script and icons for the Trash Application.
- (5.26 KiB) Downloaded 1204 times
Thanks, I'll add that to it. How would I go about changing the icons based on the contents of root/.Trash? My first thought is that I would I check for the size of the directory and anything over 0 bytes be considered full. I don't know how I would then set the icon though.GuestToo wrote:this line in AppRun will create /root/.Trash if it doesn't exist:
[ -d /root/.Trash ] || mkdir /root/.Trash
changing the trash icon (full, empty) is easy ... getting rox to show the changed icon, rather than a cached version of the old icon, is harder
I now have the icon changing every time something is added to the trash and when the trash is emptied. There are a couple of issues though.
First is that the icon isn't updated until you mouse over the trash icon (just like the Filer windows).
Second is that the application HAS to be placed in /root/my-applications/bin
Here is the code. Any recommendations? Any body know how to get rox to refresh icons from a shell command?
First is that the icon isn't updated until you mouse over the trash icon (just like the Filer windows).
Second is that the application HAS to be placed in /root/my-applications/bin
Here is the code. Any recommendations? Any body know how to get rox to refresh icons from a shell command?
Code: Select all
#!/bin/sh
# July 2, 2005 - Dan Van Wormer - Puppy Linux
[ -d /root/.Trash ] || mkdir /root/.Trash
test -sd "$@"
if [ "$?" = "0" ]
then
exec rox /root/.Trash
else mv "$@" /root/.Trash/
cp /root/my-applications/bin/Trash/trashcan_full.png /root/my-applications/bin/Trash/.DirIcon
fi
if [ "$1" = "-empty" ]
then
rm -r /root/.Trash/*
cp /root/my-applications/bin/Trash/trashcan_empty.png /root/my-applications/bin/Trash/.DirIcon
fi