antiX-forum Forum Index antiX-forum
Forum for users of antiX linux. "Mean and Lean"
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Welcome
Welcome to antiX-forum.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

[How to] use idesk for mounting devices

 
Post new topic   Reply to topic    antiX-forum Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
OU812



Joined: 29 Sep 2007
Posts: 456
Location: California

PostPosted: Fri Jul 04, 2008 7:31 am    Post subject: [How to] use idesk for mounting devices Reply with quote

Hello. I stumbled across this thread 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:
#!/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:
chmod a+x /path/ideskmount.sh

3. Copy to /usr/local/bin/. Become root and do

Code:
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:
mkdir /home/your_name/.idesktop/

Now create a file for each mountable device. Here's an example for my cdrom:

Code:
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:
ideskmount.sh /media/cdrom

5. Edit your startup file - either fluxbox or icewm. Add this line

Code:
(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:



Enjoy.

john
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    antiX-forum Forum Index -> Tips and Tricks All times are GMT + 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Chest


Powered by phpBB
Hosted by FreeForums.org