![Sad :(](./images/smilies/icon_sad.gif)
EDIT: Moving everything to /media doesn't seem to really cause any problems. I wonder if there's any gotchas I'm not thinking of.
What about hard links?jemimah wrote:I got the mount point names working. Unfortunately a symlink to /media is not good enough. The drive must actually be mounted there.
A lot of scripts need to be updated.jemimah wrote:EDIT: Moving everything to /media doesn't seem to really cause any problems. I wonder if there's any gotchas I'm not thinking of.
It won't let you hard link directories. (Plus I think it actually runs something like "mount |grep "/media".) As far as I can tell, only two scripts need to be patched, drive_all, and pmount. /mnt/home stays where it is.abushcrafter wrote:What about hard links?jemimah wrote:I got the mount point names working. Unfortunately a symlink to /media is not good enough. The drive must actually be mounted there.
A lot of scripts need to be updated.jemimah wrote:EDIT: Moving everything to /media doesn't seem to really cause any problems. I wonder if there's any gotchas I'm not thinking of.
Greatjemimah wrote:Great! I now have a working patch for libgio that fixes this.
Code: Select all
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
if [ ! -f /tmp/blkid.txt ]; then
blkid -c /dev/null > /tmp/blkid.txt
fi
blkid_cleaner &
LABEL=""
eval $( cat /tmp/blkid.txt | grep "$@:" | cut --delimiter=" " -f 2- | sed -e 's/ /;/g' )
LABEL=${LABEL//;/ }
#Generate drive label
if [ "$LABEL" = "" ]; then ONEDRVLABEL="$@\n \n "; else ONEDRVLABEL="${LABEL}\n($@)\n "; fi
}
Code: Select all
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
}
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
}
I don't think GTK file dialog runs 'mount | grep "/media" '. I concluded this by the following experiment on Puppy 412.jemimah wrote: Plus I think it actually runs something like "mount |grep "/media"
Code: Select all
# mount | grep "/media"
/dev/sda5 on /media/sda5 type fuseblk (rw,user_id=0,group_id=0,blksize=4096)
/dev/sda6 on /media/sda6 type fuseblk (rw,user_id=0,group_id=0,blksize=4096)
#
abushcrafter wrote: I find I need more padding between the icons because I have longer labels than you two do.
I searched a lot but couldn't find any option for changing text alignment in ROX-FilerSit Heel Speak wrote: When the drive icons are arranged vertically, as in this screencap, the justification of the labels (both volume label and partition drive+number) should not be "center" but rather should match the orientation of the icons, e.g. "right", "left".
...
If it were possible to set margins in icewm, like you can in openbox, it is hard to imagine how it could be better.
Code: Select all
#!/bin/sh
function blkid_name_generator() {
#Copied from pup_event_frontend_d and edited: blkid_name_generator(), Finds drive labels
#Gather blkid output and filter out required device
LABEL=""
eval $( blkid | grep "$@:" | cut --delimiter=" " -f 2- | sed -e 's/ /;/g' )
LABEL=${LABEL//;/ }
#Generate drive label
if [ "$LABEL" = "" ]; then ONEDRVLABEL="$1"; else ONEDRVLABEL="${LABEL}($1)"; fi
ONEDRVDISP=${ONEDRVLABEL// /%20}
}
function mksymlink() {
#Create symlinks to mountpoints in /mnt
mkdir -p /media
ln -T -s -f "$DIR" "/media/$ONEDRVLABEL"
}
function getdata() {
#Gets data from mount command
mount | grep "/dev/" | grep "/mnt/" | cut -d " " -f 1-3 |
while read DRIVEU W DIR ; do
DRIVE=${DRIVEU##*/}
blkid_name_generator "$DRIVE"
echo -n "file:///media/$ONEDRVDISP\n"
mksymlink "$DIR"
done
}
function chkdata() {
#Cutdown of getdata just for checking for changes
mount | grep "/dev/" | grep "/mnt/"
}
NEWCDATA=""
while [ 1 = 1 ]; do
OLDCDATA="$NEWCDATA"
NEWCDATA="$( chkdata )"
if [ "$OLDCDATA" != "$NEWCDATA" ]; then
NEWDATA="$( getdata )"
#Filter out old entries
echo -n > /tmp/gtk-bookmarks
cat /root/.gtk-bookmarks |
while read LINE; do
case "$LINE" in
file:///media/*/*)
[ "$LINE" != "" ] && echo "$LINE" >> /tmp/gtk-bookmarks
;;
file:///media/*)
;;
*)
[ "$LINE" != "" ] && echo "$LINE" >> /tmp/gtk-bookmarks
;;
esac
done
#Add new entries
echo -ne "$NEWDATA" > /root/.gtk-bookmarks
cat /tmp/gtk-bookmarks >> /root/.gtk-bookmarks
echo "updated"
fi
sleep 1
done
That will be complete name of the script.abushcrafter wrote:I call the script that shows mounted drives in GTK File Dialog, by modifying /root/.gtk-bookmarks file "showmounteddrivesingtkfiledialogworkaround".
Code: Select all
Linux Mint 8 Helena - Main Edition \n \l
I am using exactly same method to detect Puppy Linux. Extract initrd.gz, then execute DISTRO_SPECS (for earlier versions, read PUPPYVERSION which contains 3-digit puppy version number). This gives the name as well as the version. Then pick the kernel present in the same directory (and hope for the best) and go. This method works perfectly even if SFS files are in other partition.Flash wrote:Is what's in /etc/DISTRO_SPECS or /initrd/DISTRO_SPECS what you're looking for? I don't know if those are in every distro, or even every version of Puppy.
I got hold of grub4dos-0.4.4.v1.7.pet and extracted it and found that the mechanism to detect Windows was very simple:nooby wrote: Akash if you look on grub4dosconfig that Shinobar has a thread about does not that one list every OS that is installed?
Code: Select all
case $KEYFILE in
/bootmgr) DISTRO_NAME="Windows Vista/2008/7" ;;
/ntldr) DISTRO_NAME="Windows NT/2000/2003/Xp"
[ -f $TOPDIR/boot.ini ] && DISTRO_NAME=$(grep 'WINDOWS=' $TOPDIR/boot.ini| head -n 1| cut -d'=' -f2| cut -d'/' -f1| tr -d '"' | trim)
[ "$DISTRO_NAME" = "" ] && DISTRO_NAME="Windows NT/2000/2003/Xp"
;;
/io.sys) DISTRO_NAME="Windows 9x/Me";;
esac