Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 26 Nov 2014, 10:19
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
put icons for unmounted items on desktop
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
miriam


Joined: 06 Dec 2006
Posts: 281
Location: Queensland, Australia

PostPosted: Fri 20 Apr 2007, 20:28    Post_subject:  put icons for unmounted items on desktop
Sub_title: how to make icons of folders available from the desktop even if they are inside unmounted drives
 

Here is a simple technique I find very useful. Perhaps it might be of help to others.

I like to keep a lot of links to commonly used folders on my desktop. For safety's sake I also like to make a few partitions on my drives to keep programs and various kinds of data away from each other.

- Puppy gets its own partition.
- A swap partition is useful too.
- I like to have another partition for external programs, like POV-Ray for instance, that don't really need to be a part of the Puppy file layout. This makes re-installing later much simpler because I don't need to replace more than a couple of configuration files.
- Another partition is given over to my work stuff.
- Another is devoted data: to my collection of electronic books, useful html info I have found cruising the web, video and audio files.

As a drive can only have 4 primary partitions, this means I usually have a second hard drive.

Keeping everything separate like this brings some benefits. If anything goes wrong on one partition or drive then I lose, at most, only the stuff there. Searching and backing up are easier too.

But there is one tiny annoyance. I like to keep links to commonly used folders on my desktop, but when I boot Puppy only / is mounted. The other folders on unmounted partitions and drives appear as as an error icon.

Here is how I've solved it:

In my /root/.jwm folder I keep some shell scripts that do the trick. Here is one:
Code:
#! /bin/sh

mount /mnt/hdb2
rox /mnt/hdb2/text/non-fiction/reference

When clicked, it mounts the partition then opens your filetree browser (in my case rox) to display the contents of the folder.

I drop the shell script onto my desktop to make a link there. Now I give it a special folder icon to make it stand out. Here is a link to a bundle of folder icons I've made that I use a lot.
http://miriam-english.org/files/folders.tar.gz

I hope some people find this helpful.

_________________
A life! Cool! Where can I download one of those from?
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Sat 21 Apr 2007, 22:53    Post_subject:  

Hi miriam;

With a little more code you could make a second click close ROX & unmount.
Back to top
View user's profile Send_private_message 
veronicathecow


Joined: 21 Oct 2006
Posts: 535

PostPosted: Sun 22 Apr 2007, 03:22    Post_subject:  

Hi, thanks for tip, but being a newbie some more detailed instructions would be very useful. Many thanks.
Back to top
View user's profile Send_private_message 
klhrevolutionist


Joined: 08 Jun 2005
Posts: 1124

PostPosted: Sun 22 Apr 2007, 12:47    Post_subject:  

This would make a good boot time option to mount or not to .

The way I do it is by editing my /etc/rc.local file & adding the mount command to mount the partitions I would like to. And open rox copy the folder onto the desktop & I am finished.

simple

_________________
Heaven is on the way, until then let's get the truth out!
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Sun 22 Apr 2007, 13:46    Post_subject:  

Hi veronicathecow; Here's a script to make it do that:
Code:
#!/bin/sh
DEV='/dev/hda3'               ### put correct device here !!!
MNT='/mnt/'`echo $DEV |cut -f 3 -d '/'`
if [ -n "`mount |grep $DEV`" ];then
  umount $DEV
else
 mkdir -p $MNT
 TYPE=`probepart |grep $DEV |cut -f 2 -d '|'`
 mount -t $TYPE $DEV $MNT
fi


It checks if the partition is mounted, it mounts it if it's not & unmounts it if it is.
If I knew how... It'd be nice if the icon changed (mounted / unmounted).
I didn't test it, but it's very simple, tell me if it's buggy...

P.S. I just realized that this post is a Q & not a solution.
So this should be in another forum line.


KLH; Here's a boot mounter GUI that I wrote about a year ago.
Run & choose partitions to mount at boot, at NEXT BOOTUP they're mounted.
xbootmount.gz
Description  Uncompress & put in: /root/my-applications/bin
gz

 Download 
Filename  xbootmount.gz 
Filesize  1.16 KB 
Downloaded  371 Time(s) 
Back to top
View user's profile Send_private_message 
miriam


Joined: 06 Dec 2006
Posts: 281
Location: Queensland, Australia

PostPosted: Sun 11 Nov 2012, 18:10    Post_subject:  

Revisiting this old post... I have learned a lot more in the intervening period. I know the new system Puppy has for automatically recognising drives has some advantages, but I still prefer the system I detail below for all permanent drives and some external drives. I know it seems a bit involved, but it is easy and only needs to be done once.

First I edit the /etc/fstab file to add the drives that I want the system to mount and to give them informative names:
Code:
# <file system> <dir>      <type>   <options>      <dump> <pass>
/dev/sda1      /         ext3   defaults      0 1
none         /proc      proc   defaults      0 0
none         /sys      sysfs   defaults      0 0
none         /dev/pts   devpts   gid=2,mode=620   0 0
/dev/fd0      /mnt/floppy   auto   noauto,rw      0 0

none         /mnt/ram0   ramfs   defaults      0 0

#/dev/cdrom      /mnt/cdrom   iso9660   noauto,user,ro   0 0
/dev/dvd      /mnt/optical   auto   defaults,ro      0 0

##############################
#
#    automounting is done at
#     /etc/rc.d/automount
#
##############################
/dev/sda2   /mnt/big   ext3   defaults      0 0

/dev/sdb1   /mnt/pup4   ext3   defaults      0 0
/dev/sdb2   /mnt/work   ext3   defaults      0 0

/dev/sdc1   /mnt/pup2   ext3   defaults      0 0
/dev/sdc2   /mnt/store   ext3   defaults      0 0

LABEL=wd0   /mnt/wd0   ext3   defaults      0 0
LABEL=wd1   /mnt/wd1   ext3   defaults      0 0
LABEL=wd2   /mnt/wd2   ext3   defaults      0 0
The first several lines down to the first blank line will already be in your fstab (or something very much like them). Don't touch them. I added a line at the top to remind me what the columns each do. Note the '#' at the beginning of the line this tells the computer to ignore that line.

The first actual useful line I added was the one to make a ramdisk available. I might end up mounting that as /tmp as some people do, but I'm not really convinced of the usefulness of that on machines other than flashdrive-based (ramdisks are useful for flashdrive-based machines to limit the number of read/write/delete cycles wearing out the drives). At the moment it is mostly useful for some scripts I write that need frequent access to temporary files as quickly as possible.

Many books suggest defining CDs as iso9660, but this won't work for UDF formatted optical disks. (I've commented this line out to show you what NOT to add.) I use one icon for both CD and DVD and call it 'optical'.

Next I have a big reminder for me that I keep a small script /etc/rc.d/automount for mounting certain drives automatically at startup. More on that in a minute.

Next I give some example drives and partitions. The last 3 lines are especially interesting as they let your system recognise drives by their label.

Make sure that you make a folder in /mnt for each of these entries, named the same as the second column. For example, the line
Code:
/dev/sda2   /mnt/big   ext3   defaults      0 0
means that I need to make a folder called "big" in my /mnt folder. Now drag to your desktop the drive icons you want. If you want a special icon for some (for example "optical" and "ram0" then right-click the created folder icon and set a specific icon for it.

Now we turn to the /etc/rc.d/automount file
Code:
#!/bin/sh
# this script is called from /etc/rc.d/rc.local
mount /mnt/big
mount /mnt/work
mount /mnt/store
mount /mnt/ram0
Here I have a simple list of the drives I always want available. As the commented-out line notes, this file is run from a line I've added to the /etc/rc.d/rc.local file. I could have added these lines directly into /etc/rc.d/rc.local, but I like keeping functions separate to make it easier for me to remember what's going on. The Puppy system drive I boot on will be automounted anyway, so I don't need to include that in the list (in the case above, /dev/sda1), and I prefer to keep other Puppy partitions unmounted unless I need them, in which case clicking on the desktop icon mounts it for me. A nice side-effect of this method is that closing the last open window from a drive that was click-mounted asks if I want to unmount the drive or not.

Note that the labelled external drives will wait until I plug them in. When they are available then I click on the named drive icon and it will be mounted by its named label rather than the USB port it is plugged into. This is a great advantage for many things.

I won't go into it here just now, but I have mostly disabled Puppy's normal automounting system for everything except removable drives (thumbdrives, etc) so that I don't have extra system drive icons on my desktop.

_________________
A life! Cool! Where can I download one of those from?
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Mon 12 Nov 2012, 16:37    Post_subject:  

Hi miriam; I was surprised to see this old post thread.! Your setup looks interesting, and as you say, a little involved.
I like not having icons all over my desktop too. So I dislike Puppy`s manner of scattering them across the desktop.

I thought about making my apps. use fstab, but it does no better than simple commands to mount and unmount.
And yeah, disabling the Puppy event also disables USB mounting ( I think...). Need it to be less imbedded.

I`d like a good desktop slide-out panel for drive icons, can`t find one, I`ll probably have to write one myself.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0827s ][ Queries: 12 (0.0093s) ][ GZIP on ]