Desktop drive icons fix
August 28, 2011 —
BarryK
Those who are using a Puppy built from recent Woof will notice on the first boot that the drive icons draw along the bottom of the screen rather slowly.
One-second intervals in fact. I had put a "sleep 1" into the code to delay the icon changing from mounted to unmounted, as there is a problem with a USB activity-light flashing up to a second beyond the drive being unmounted (and 'sync' completed).
However, this 1-second is also delaying the initial drawing of the icons. Furthermore, the 1-second delay was only supposed to occur for USB drives but is happening for all.
So, I have changed the test for the 1-second delay in /etc/rc.d/functions4puppy4:
icon_unmounted_func() {
#passed params: drivename category ex: sda usbdrv
DRVICON="drive48.png" #default.
[ "$2" = "usbdrv" ] && DRVICON="usbdrv48.png"
[ "$2" = "card" ] && DRVICON="card48.png"
[ "$2" = "floppy" ] && DRVICON="floppy48.png"
[ "$2" = "optical" ] && DRVICON="optical48.png"
#find out if already done...
if [ -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons ];then
GLOBLINES="`cat /root/.config/rox.sourceforge.net/ROX-Filer/globicons | tr '\n' '|' | sed -e 's%</rule>|%\n%g'`"
diPATTERN='/root/.pup_event/drive_'"${1}"'"'
[ "`echo "$GLOBLINES" | grep "$diPATTERN" | grep "$DRVICON"`" != "" ] && return
fi
#[ "`echo "${ATADRIVES}" | grep "${1}"`" = "" ] && sleep 1 #110722 usb drive, LED light briefly flashes after unmounted, so wait a bit. ATADRIVES is in /etc/rc.d/PUPSTATE.
[ "$2" = "usbdrv" ] && sleep 1 #110828 above test doesn't work.
echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
<env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
<SetIcon>
<Path>/root/.pup_event/drive_${1}</Path>
<Icon>/usr/local/lib/X11/pixmaps/${DRVICON}</Icon>
</SetIcon>
</env:Body>
</env:Envelope>" | rox -R
}
I have no idea why the previous test does not work. This change should fix it, at least now the internal drive icons will draw fast.
Comments
ATADRIVESUsername: L18L
ATADRIVES is in /etc/rc.d/PUPSTATE. Yes it is but there is NO actualization of ATADRIVES in PUPSTATE after plugging in. Using wary513 Hope that helps
sleep removed
Username: BarryK
"I thought about it some more, have removed the "sleep 1" completely. That is the wrong place for it.
Tags: woof