From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Shaw Date: Fri, 01 Feb 2002 13:09:19 +0000 Subject: User-level Tasks in Hotplug Scripts? Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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