Some suggestions that will make Puppy excellent

What features/apps/bugfixes needed in a future Puppy
Message
Author
User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#21 Post by jemimah »

I got the mount point names working. Unfortunately a symlink to /media is not good enough. The drive must actually be mounted there. :(

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.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#22 Post by abushcrafter »

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. :(
What about hard links?
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.
A lot of scripts need to be updated.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#23 Post by disciple »

Might be easier to patch GTK to use /mnt instead of /media ;)
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#24 Post by jemimah »

abushcrafter wrote:
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. :(
What about hard links?
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.
A lot of scripts need to be updated.
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.

Disciple's probably right though, a gtk patch is a more elegant solution.

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#25 Post by jemimah »

Great! I now have a working patch for libgio that fixes this.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#26 Post by abushcrafter »

jemimah wrote:Great! I now have a working patch for libgio that fixes this.
Great 8).

With the drive labels for the desktop drive icons. I find I need more padding between the icons because I have longer labels than you two do. Examples: "goodcontent" and "alexanderspuppyl".
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#27 Post by jemimah »

Yup I've fixed that too.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#28 Post by abushcrafter »

So why does the syslink "/mnt/home" work then?

Looking forward to you sharing your goodies :wink:. I hope they could be squeezed into the next/current Lupu, LHP and Wary releases.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

Suggestion on drive icons with volume label

#29 Post by Sit Heel Speak »

Thank you very much akash_rawal and upnorth and jemimah, this is really useful!

Suggestion --if anyone is skilled enough and cares:

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". This will enable placement of the drive icon as close to the edge as possible, which allows a little bit bigger windows without totally eclipsing the drive icons.

Also it would allow perfect alignment even in the case when some (or in my case, most) of the drive partitions do not have volume labels.

I must say...the screencap is of Puppy Studio 3.3's icewm, on a 20" monitor at 1600x1200, with the positions of the icewm taskbar and wbar swapped...drive icons told to line up "left" in
/etc/eventmanager...gkrellm added...this Puppy Studio 3.3 version of icewm (icewm-1.3.7pre2-L519-lucid) is the best window manager I have ever seen in Puppy. Windows open in logical places and usually at reasonable sizes. It is even better than openbox and enlightenment e17. And that's saying something.

If it were possible to set margins in icewm, like you can in openbox, it is hard to imagine how it could be better. Well, maybe if it had the same right-click-on-titlebar, remember-position-and-size that e17 has. But even without an explicit remember function it does much better than jwm, openbox, e17 and earlier versions of icewm as far as opening new windows in logical places.
Last edited by Sit Heel Speak on Wed 02 Feb 2011, 17:28, edited 3 times in total.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#30 Post by nooby »

Looks very helpful this one.

Don't get angry now but when one do search using google then labels and Label can get mixed very easily :)

labels being what can be read under the icon on a desktop
Label being the UUID that is a random? long unintelligent uuid 7ak5.... human not easily remembered line of chars.

Desktop label
Harddisk label
I use Google Search on Puppy Forum
not an ideal solution though

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#31 Post by akash_rawal »

A few more suggestions added, see the first post.
__________________________________________________________________________

I recently learnt usage of "cut" command and using it I made a better script to show drive labels.
Add these functions to /sbin/pup_event_frontend_d:

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
}
Then edit the functions named add_pinboard_func and remove_pinboard_func as follows-

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
}

This one is a bit faster ( and I also think that the option "-c /dev/null" corrects the problem of incorrect output when another somewhat similarly partitioned hard disk is connected ).
One additional newline at end of each label ensures that the original margin is restored.
_____________________________________________________________________________
jemimah wrote: Plus I think it actually runs something like "mount |grep "/media"
I don't think GTK file dialog runs 'mount | grep "/media" '. I concluded this by the following experiment on Puppy 412.
I extracted the pup_412.sfs file into a directory. Then I renamed /mnt to /media, created symlink /mnt pointing to /media and recombined it into an sfs.
When I got puppy to boot using the sfs file thus formed, I got very unexpected results. I mounted a few drives and then opened GTK file dialog, but no drives were listed there (except root and File System). When I ran 'mount | grep "/media" ' in terminal I got:

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.
Sit 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.
I searched a lot but couldn't find any option for changing text alignment in ROX-Filer
I think that icons could be better placed in a panel instead of on pinboard as follows-
Image
This will have several advantages:
1. Users will have choice of aligning icons against any side of the screen.(However at the bottom the panel will be partially covered by the taskbar, rendering it useless)
2. ROX-Filer will automatically manage panel width and icon spacing to accommodate longer labels.
3. Panels can be configured not to allow maximized windows to cover them, so window managers like openbox is not needed for that purpose.
_____________________________________________________________________________
Last edited by akash_rawal on Tue 12 Apr 2011, 06:57, edited 1 time in total.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#32 Post by akash_rawal »

I found a way to show mounted drives in GTK File Dialog, by modifying /root/.gtk-bookmarks file.
Just copy the following in a text file in /root/Startup:

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
		
Then restart X or execute it.
After that mounted drives will appear in the side pane, with their labels.
Only problem is that the drive will be given a folder-like icon, so users can misinterpret it as a bookmark.
Screenshot:
Image
Last edited by akash_rawal on Tue 12 Apr 2011, 07:01, edited 1 time in total.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#33 Post by abushcrafter »

Thanks akash_rawal :D.

I call the script that shows mounted drives in GTK File Dialog, by modifying /root/.gtk-bookmarks file "showmounteddrivesingtkfiledialogworkaround". So can we all agree on this or a name then?
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#34 Post by akash_rawal »

abushcrafter wrote:I call the script that shows mounted drives in GTK File Dialog, by modifying /root/.gtk-bookmarks file "showmounteddrivesingtkfiledialogworkaround".
That will be complete name of the script.
Consider having underscores between terms, like "show_mounted_drives_in_gtk_file_dialog_workaround".

However I hardly bother to give long names. I had just named the file "show_mounted_drives" and finished the story!

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#35 Post by akash_rawal »

It is strange that no one moved the discussion to next topic i.e. automatically detecting different OSes installed on the computer and generating correct config to boot them using grub.

I have performed many experiments on virtualbox with many different setups of hard disks and controllers and found that grub-install command gets confused with many of the setups.(I haven't tested grub bootloader config yet) I am now almost sure how grub detects various drives.

Now all I have to search is a program or a library that can give detailed information about all the controllers and drives attached to them. Till now I haven't found it.

Next challenge is to detect different OSes installed in the computer and generating correct config. This is easy for windows, just checking the presence of windows bootloader files is enough. For linux, apart from detecting location of kernel and initrd, correct options have to be found out. Detecting puppy linux is most difficult. Puppy can have kernel and initrd in one drive and its sfs and save files in another drive.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

Stuck at slving second problem

#36 Post by akash_rawal »

I have started writing a bootloader config program which could autodetect OSes. But I am stuck at a problem. How could my program detect which OS is installed in a particular drive?

I have already written code which could detect presence of Linux in a particular drive and generate configuration that should work for many Linux. But I don't know how to find which Linux is that. The same applies to Windows.Puppy Linux excluded, I have already written an almost foolproof code that can detect presence of Puppy Linux and generate correct config, even if the SFS files are in other partition.

I have seen Ubuntu and Linux Mint installers automatically detecting all windows and many Linux distros correctly. I wonder how they do that. On searching with Google I get unwanted results.

Development of my program has reached the point from where I cannot continue without solving the problem. Please help.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#37 Post by akash_rawal »

I accidentally found this web page:
http://www.doxer.org/learn-linux/linux- ... an-ostype/
I found that reading /etc/issue gives the name of the entire OS. /etc/issue file in my Linux Mint installation reads:

Code: Select all

Linux Mint 8 Helena - Main Edition \n \l
I easily get the name of the Linux ready to be displayed in boot menu.
I think this will work for many popular Linux (Please check whether I am correct). For other Linux my program can at least show "Unknown Linux (on <drive_name>)" and generate config that should work for most Linux I think.

Now I just have to find ways to fight off the problem of autodetecting windows. Am I missing out any other OS?

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#38 Post by Flash »

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.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#39 Post by nooby »

Akash if you look on grub4dosconfig that Shinobar has a thread about does not that one list every OS that is installed?
I use Google Search on Puppy Forum
not an ideal solution though

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#40 Post by akash_rawal »

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 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.
nooby wrote: Akash if you look on grub4dosconfig that Shinobar has a thread about does not that one list every OS that is installed?
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:

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
It can detect that Windows Vista/2008/7 is installed in a drive, but can't distinguish between Windows Vista, 2008 and 7. Linux Mint and Ubuntu installers are able to do that.

Post Reply