put icons for unmounted items on desktop

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
miriam
Posts: 373
Joined: Wed 06 Dec 2006, 23:46
Location: Queensland, Australia
Contact:

put icons for unmounted items on desktop

#1 Post by miriam »

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: Select all

#! /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.
[color=blue]A life! Cool! Where can I download one of those from?[/color]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

Hi miriam;

With a little more code you could make a second click close ROX & unmount.

User avatar
veronicathecow
Posts: 559
Joined: Sat 21 Oct 2006, 09:41

#3 Post by veronicathecow »

Hi, thanks for tip, but being a newbie some more detailed instructions would be very useful. Many thanks.

User avatar
klhrevolutionist
Posts: 1121
Joined: Wed 08 Jun 2005, 10:09

#4 Post by klhrevolutionist »

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!

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#5 Post by sunburnt »

Hi veronicathecow; Here's a script to make it do that:

Code: Select all

#!/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.
Attachments
xbootmount.gz
Uncompress & put in: /root/my-applications/bin
(1.16 KiB) Downloaded 507 times

User avatar
miriam
Posts: 373
Joined: Wed 06 Dec 2006, 23:46
Location: Queensland, Australia
Contact:

#6 Post by miriam »

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: Select all

# <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: Select all

/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: Select all

#!/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.
[color=blue]A life! Cool! Where can I download one of those from?[/color]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#7 Post by sunburnt »

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.

Post Reply