pengin drive icon di puppy linux kamu seperti ini?
apa yang berbeda dari tampilan drive icon di atas?
ya, benar sekali.
kalau biasanya hanya sda1, sda2, sda3, dst., tapi sekarang
ada label nama tiap drive.
begini caranya.
1. buka file /sbin/pup_event_frontend_d dengan geany. (cara yang paling mudah adalah dengan menekan shift dan file itu pada rox-filer).
2. buat dua buah fungsi berikut ini, blkid_cleaner() dan blkid_name_generator().
blkid_cleaner() {
sleep 5
if [ -f /tmp/blkid.txt ]; then rm /tmp/blkid.txt; fi
}
blkid_name_generator() {
#Gather blkid output and filter out required device
LABEL=""
eval "`blkid "/dev/$1" | cut --delimiter=" " -f 2- | sed -e 's/ /;/g'`"
LABEL="${LABEL//;/ }"
if [ ${#LABEL} -gt 8 ]
then
LABEL=${LABEL:0:8}..
fi
#Generate drive label
if test "$LABEL" = ""; then ONEDRVLABEL="$@\n \n "; else ONEDRVLABEL="${LABEL}\n($@)\n "; fi
}
3. ubah sedikit fungsi add_pinboard_func() menjadi seperti di bawah ini.
add_pinboard_func() { #needs ONEDRVNAME, DRV_CATEGORY, FSTYPE
#ppPATTERN=' label="'"$ONEDRVNAME"'"'
#v411 rerwin: avoid icon getting duplicated if it is renamed...
ppPATTERN="/root/.pup_event/drive_${ONEDRVNAME}<"
[ "`grep "$ppPATTERN" /root/Choices/ROX-Filer/PuppyPin`" != "" ] && return #precaution.
free_coord
blkid_name_generator $ONEDRVNAME
echo -e "<?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\">
<PinboardAdd>
<Path>/root/.pup_event/drive_${ONEDRVNAME}</Path>
<X>${COORD_X}</X>
<Y>${COORD_Y}</Y>
<Label>${ONEDRVLABEL}</Label>
<Args>${DRV_CATEGORY} ${FSTYPE}</Args>
</PinboardAdd>
</env:Body>
</env:Envelope>" | rox -R
if [ "$( cat /root/.drvlist | grep $ONEDRVNAME )" = "" ]; then
echo $ONEDRVNAME >> /root/.drvlist
fi
}
4. ubah juga fungsi remove_pinboard_func() menjadi seperti di bawah ini.
remove_pinboard_func() { #needs DRV_NAME (name of entire drive)
#ppPATTERN=' label="'"$DRV_NAME"'.*" '
#[ "`grep "$ppPATTERN" /root/Choices/ROX-Filer/PuppyPin`" = "" ] && return
#ALLNAMES="`grep -o "$ppPATTERN" /root/Choices/ROX-Filer/PuppyPin | cut -f 2 -d '"' | tr '\n' ' '`" #'geany
#for ONEDRVNAME in $ALLNAMES
#do
#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\">
#<PinboardRemove>
#<Path>/root/.pup_event/drive_${ONEDRVNAME}</Path>
#</PinboardRemove>
#</env:Body>
#</env:Envelope>" | rox -R
#done
#Rewritten to cope with blkid_name_generator
cat /root/.drvlist | grep "$DRV_NAME" |
while read ONEDRVNAME
do
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\">
<PinboardRemove>
<Path>/root/.pup_event/drive_${ONEDRVNAME}</Path>
</PinboardRemove>
</env:Body>
</env:Envelope>" | rox -R
sed -i -e "s/${ONEDRVNAME}//g" /root/.drvlist
done
}
5. kemudian klik kanan icon drive pilih run desktop icon manager
6. tandai (cek) tick box to erase then redraw and realign existing icons, ok.
7. kemudian restart x server melalui menu-shutdown-restart X server
jadi deh.
canggih kan?
alhamdulillaah..
:)
kalau lebih canggihnya lihat saja sumbernya dari sini:
http://www.murga-linux.com/puppy/viewtopic.php?p=532399