Posts: 1,081
OU812
Joined: 29 Sep 2007
#1
Hello. I stumbled across this thread
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://forums.gentoo.org/viewtopic-t-87262.html"
linktext was:"http://forums.gentoo.org/viewtopic-t-87262.html"
====================================
and with a little modification, it works wonderfully in antix. If you would like to use idesk to create icons on your desktop for your mountable devices, then follow these instructions.

1. Create the script to mount/unmount devices. Copy and paste into leafpad or geany. Save it as something like ideskmount.sh

Code: Select all

#!/bin/bash

#Check to see if dev is mounted, if not, mount it 
#and open it, if so just open it 
DEV=$1

isMntd=`cat /etc/mtab | grep $DEV | wc -l | sed 's/ //g'`

#If it is mounted, open it!
if ["$isMntd" -eq"1" ]; then
        mntPnt=`cat /etc/mtab | grep $DEV | cut -d' ' -f2`
        rox $mntPnt
else
        mount $DEV
        mntPnt=`cat /etc/mtab | grep $DEV | cut -d' ' -f2`
        rox $mntPnt
fi

umount $mntPnt
2. Make the script executable. Open a terminal and do

Code: Select all

chmod a+x /path/ideskmount.sh
3. Copy to /usr/local/bin/. Become root and do

Code: Select all

cp /path/ideskmount.sh /usr/local/bin/
4. Make a .lnk file for each mountable device that you want on your desktop. If you haven't already, create a dir for the .lnk files. As user do

Code: Select all

mkdir /home/your_name/.idesktop/
Now create a file for each mountable device. Here's an example for my cdrom:

Code: Select all

table Icon
  Caption: CD/DVD
  ToolTip.Caption: Browse Device
  Icon: /usr/share/icons/gTangish-2.0a1/32x32/devices/media-optical.png
  Width: 32
  Height: 32
  X: 875
  Y: 669
  Command[0]: ideskmount.sh /media/cdrom
  Command[1]: leafpad ~/.idesktop/cddvd.lnk
end
Save as (for example) cddvd.lnk in the ~/.idesktop/ folder. Change the icon and captions to whatever you like. Left clicking the desktop icon will open the device (command 0) and right clicking will open the text file for editing (command 1).

Note: To find other mountpoints for your .lnk files, just make sure the device is plugged in and find its mountpoint using rox; most are in /media/ or /mnt/. When you know the mountpoint for your device, edit this line

Code: Select all

ideskmount.sh /media/cdrom
5. Edit your startup file - either fluxbox or icewm. Add this line

Code: Select all

(sleep 2; idesk &) &
6. Now logout/login and you should be able to use your new icons (if not reboot). Feel free to reposition the icon where you like - idesk will update your .lnk file for you.

Note: Feel free to change"rox" to"pcmanfm" if that is what you use for a fm.

Here's a screenshot:

Image

Enjoy.

john