linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* User-level Tasks in Hotplug Scripts?
@ 2002-02-01 13:09 Ryan Shaw
  2002-02-01 23:58 ` David Brownell
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Ryan Shaw @ 2002-02-01 13:09 UTC (permalink / raw)
  To: linux-hotplug

Hello,

I have USB hotplugging set up on my machine 
so that pictures are automatically downloaded
from my camera (via jphoto) when I plug it in.

I would like to have the script that is run
when hotplug detects my camera launch nautilus
as well, as it is my image browser of choice.

First question: Is the hotplug script the 
right place for this? If not, where is?

Second question: If the hotplug script is
the right place, why doesn't the following
work?

Hotplugging scripts are run as root, so I have
the following line to launch nautilus:

su - ryan -c "nautilus --display=:0.0 > /home/ryan/nautilus.log 2>&1" &

This works if I just run the script as root,
but it doesn't work when the script is initiated
buy the actual hotplugging. (Pictures are
downloaded OK, just nautilus doesn't start.)

I've attached my hotplug script below.

Any light you could shed would be greatly
appreciated.

Ryan

/etc/hotplug/usb/jphoto
------------------------------------------------------------
#!/bin/sh

# if present, images are automatically downloaded
DOWNLOAD=/home/ryan/images

# where jPhoto executable is installed
JPHOTO=/usr/local/bin/jphoto

# download images and launch viewer
if [ -d $DOWNLOAD ]; then
    cd $DOWNLOAD
    (echo '*** '$(date); $JPHOTO images --directory .; echo '') \
        >> images.$(date '+%Y-%m.%d')
    chown ryan:ryan *
    su - ryan -c "nautilus --display=:0.0 $DOWNLOAD > /home/ryan/nautilus.log 2>&1" &
fi


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-02-06 14:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-01 13:09 User-level Tasks in Hotplug Scripts? Ryan Shaw
2002-02-01 23:58 ` David Brownell
2002-02-02 20:55 ` Jim Gettys
2002-02-02 22:02 ` Oliver Neukum
2002-02-02 22:12 ` Jim Gettys
2002-02-02 22:52 ` Oliver Neukum
2002-02-02 23:02 ` David Brownell
2002-02-03  0:58 ` Scott Cuyle Fritzinger
2002-02-03  8:36 ` Greg KH
2002-02-04  6:02 ` Dmitry Yu. Bolkhovityanov
2002-02-04 15:10 ` Jim Gettys
2002-02-04 19:28 ` Jim Carter
2002-02-05  3:32 ` David Brownell
2002-02-05 15:05 ` Ryan Shaw
2002-02-06 14:30 ` Marcus Harnisch
2002-02-06 14:54 ` Jim Gettys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).