creating desktop icons in users home dir



Hi,

Could anyone help me out with this.

I am trying to create 3 desktop entries which point to
zip/floppy/cdrom drives.
These have to be created for each user - home areas mounted via NFS

I have a script which when run will copy the files from a location
and place them in my test users $HOME/.gnome-desktop

however, i want this script to be run when they log in through gdm. Can
anyone tell me how to get my script executed at this point? Where
should i call it from etc...

I have tried various ways such as adding my code to
/etc/X11/gdm/PreSession and 
/etc/X11/gdm/Session/Default

This does not work, my code is being executed (as i have some echo
statements outputting debug msg's to /tmp/debug which are tellling
me what i want to hear) , however the copy command do not actually copy. 
If i run this code once the user is logged in, the code does work and the 
files get copied across.

Is there some directory protection going on or something with gdm or
nautilus?

I would desparately appreciate some help on this.

Thanks

Martin

p.s. here is my code if it helps.

#!/bin/sh

mkdir -p /home/$USER/.gnome-desktop

ZIP_SRC='/usr/local/DRIVE-LINKS/zip.desktop'
FLOPPY_SRC='/usr/local/DRIVE-LINKS/floppy.desktop'
CDROM_SRC='/usr/local/DRIVE-LINKS/cdrom.desktop'

ZIP_DEST="/home/$USER/.gnome-desktop/zip.desktop"
FLOPPY_DEST="/home/$USER/.gnome-desktop/floppy.desktop"
CDROM_DEST="/home/$USER/.gnome-desktop/cdrom.desktop"

if [ ! -f $ZIP_DEST ]; then
  echo "No Zip Icon found" >> /tmp/debug
  cp $ZIP_SRC $ZIP_DEST                       # This doesnt work
  echo "cp $ZIP_SRC $ZIP_DEST" >> /tmp/debug  # This looks good in /tmp/debug
  chmod 600 $ZIP_DEST
fi;

if [ ! -f $FLOPPY_DEST ]; then
  cp $FLOPPY_SRC $FLOPPY_DEST
  chmod 600 $FLOPPY_DEST
fi;

if [ ! -f $CDROM_DEST ]; then
  cp $CDROM_SRC $CDROM_DEST
  chmod 600 $CDROM_DEST
fi;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]