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

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.

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?

should set $APPDIR to the dir AppRun is in
although you can have problems if the dir has spaces in the name

so a copy command like this should work:

cp -f "$APPDIR/trashcan_empty.png" "$APPDIR/.DirIcon"

or since you have already cd'ed to $APPDIR, maybe:

cp -f trashcan_empty.png .DirIcon

(the reason to cd to $APPDIR then `pwd`, is to make the path in $APPDIR absolute, rather than relative ... if you don't care if the path is absolute or relative, then
APPDIR=`dirname "$0"`
would probably work)

(export APPDIR if you need $APPDIR in sub-processes)

i don't know if there's a practical way to get the icon to refresh ... restarting the pinboard should work, kinda drastic though

I have updated the application to automatically create /root/.Trash if it does not already exist. The trash icon will now change based on if it is full or empty. It also does not matter where the application resides. In order to automatically update the icon I automatically restart the Pinboard. On my system this just causes a slight flicker of the desktop icons. I have not seen any ill side effects. Please let me know if there are any issues with doing this. It may take longer on slower systems. I could not get rox -x "$APPDIR/.DirIcon" to work.
Here is the code.

i haven't tried your latest version, but if you restart the pinboard from a dir other than $HOME, it might change what rox thinks is $HOME

you might want to check that when you click the rox icon, it opens a window showning $HOME (/root) and that clicking the home button goes to /root

in other words, if might be better to
cd ${HOME}
before restarting the pinboard

also, if someone is using a non-standard pinboard
(i once had 3 or 4 desktops, with icons to flip from one to another ... rox -op 1 ... rox -op 2 ... rox -op 3), your program would switch from the non-standard pinboard to the standard Puppy pinboard

which is probably not important, but it is another thing to think about when you write a program

i haven't tried your latest version, but if you restart the pinboard from a dir other than $HOME, it might change what rox thinks is $HOME

you might want to check that when you click the rox icon, it opens a window showning $HOME (/root) and that clicking the home button goes to /root

in other words, if might be better to
cd ${HOME}
before restarting the pinboard

I have tested it on two systems so far and rox still goes to /root as $HOME so it shouldn't be an issue but I will add cd ${HOME} just to be on the safe side.

Puppy running on my iBook in Virtual PC is equivalent to a 200MHz PII or slower. Restarting the Pinboard on that system is definitely more than just a flicker. I may have two versions of Trash. One for faster hardware (my 800MHz VIA for example) that restarts the Pinboard, and another for slower hardware (200MHz and less) that requires you to mouse over the icon for it to be updated. The last thing to work on is the numerical increments of duplicate names in the trash. Once that is done (if I can get it to work ) I will put it into a DotPup and post it on the Wiki.

Well I think this is it. I had to change the logic a little because it was changing the icon twice when emptying the trash. While this didn't hurt anything it made things just that much slower on older hardware. It will now add a unique number to the end of anything being sent to the Trash. This is to prevent files from being over written. When right clicking the trash icon you now have two choices. The first choice (Empty the Trash) will display every thing in the Trash and ask for confirmation before deleting them. The second option (Quickly Empty the Trash) does not display a list of items and does not ask for confirmation. Lastly it also plays a little sound when things are sent to the Trash and when the Trash is emptied. If this meets with approval I will make it a Dotpup and also a Simple-Trash Dotpup that does not restart the pinboard and does not have the sound file. Here is the code.

To tell the truth I don't know since you always run as root in Puppy. As long as the application can read and write to /root it should work.

Then the answer is no.
Or if the app has access to /root then it's a security risk (probably mean a user could see and erase root's trash files, no good)._________________Mandriva LE 2005 user and puppy newbie

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum