# idesk icon file creator...

## epx

This is just a quick script I threw together to generate .lnk files for me for use with idesk.

```
#!/bin/bash

#Script to automate the icon creation process in idesk

printf "Icon filename (minus the extension): "

read fileName

touch /home/$USER/.idesktop/$fileName.lnk

outFile=/home/$USER/.idesktop/$fileName.lnk

printf "Caption: "

read caption

printf "Icon Path: "

read icPath

printf "Primary Command: "

read priComm

printf "Secondary Command: "

read secComm

echo "table Icon" > $outFile

echo "  Caption: "$caption >> $outFile

echo "  Icon: "$icPath >> $outFile

echo "  Command[0]: "$priComm >> $outFile

if [ "$secComm" ]

then

 echo "  Command[1]: "$secComm >> $outFile

fi

echo "end" >> $outFile

echo "Icon Created."

```

I also wrote this little script to automount devices, I use this script as the primary command for my idesk icons that refer to devices.

Syntax is simple: scriptname mountpoint

```
#!/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`

        nautilus --no-desktop $mntPnt

else

        mount $DEV

        mntPnt=`cat /etc/mtab | grep $DEV | cut -d' ' -f2`

        nautilus --no-desktop $mntPnt

fi

umount $mntPnt

```

----------

## christsong84

nifty...thanks!  :Very Happy: 

----------

## Marctraider

Thanks, saves me some seconds again :)

----------

## rush_ad

now, i'm new to gentoo and i've no idea how to use your work. please explain.

also, i've problem with idesk on fluxbox. i recently changed to qingy from gdm. when i started fluxbox with gdm, idesk came up on startup but with qingy it doesnt automatically comeup. any solution?

----------

## wescott

Also, there is idesk-extras.  It is simply a small script that allows you to graphicaly configure/add/remove icons from your desktop. It isn't in portage, but there is a howto for it here:

 :Arrow:  http://wiki.linuxquestions.org/wiki/Idesk

Perhaps I'll add a cleaner written howto for it on this forum soon.  I'll experiment with it more to see if I can add some stuff to make it more accessible on a Gentoo system.

----------

## Marctraider

Ahh thats nice  :Very Happy: 

But o well, i use KDE nowadays. :Rolling Eyes: 

----------

