LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-05-2007, 01:59 AM   #1
baloon
LQ Newbie
 
Registered: Jan 2007
Posts: 20

Rep: Reputation: 0
Question hotplug action


hello

I need to create a script which will start nautilus when a usb pen drive is inserted into the slot. I created a script in /etc/hotplug/usb/<usb-storage> as below.

#!/bin/sh

DISPLAY=localhost:0.0
echo "Storage is inserted " >/tmp/hahaha


case $ACTION in
add)
echo "Action is to add storage device" >>/tmp/hahaha
echo "Display = $DISPLAY" >>/tmp/hahaha
nautilus /media/usbdisk 2>>/tmp/hahaha
;;
remove)
echo "Action is to remove storage devide" >>/tmp/hahaha
;;
*)
echo "Default action = $ACTION"
;;

esac

This script doesn't open nautilus program. The following is the contents of /tmp/hahaha.

Storage is inserted
Action is to add storage device
Display = localhost:0.0
start nautilus

(nautilus:5820): Gtk-WARNING **: cannot open display:


how do I resolve this ?

-B
 
Old 03-07-2007, 12:09 PM   #2
joel2001k
Member
 
Registered: Mar 2007
Distribution: GNU/Linux debian unstable main
Posts: 79

Rep: Reputation: 17
I think use the --display argument eg. 'nautilus --display :0.0'
 
Old 03-16-2007, 04:55 PM   #3
synx
LQ Newbie
 
Registered: Mar 2007
Location: limbo
Distribution: Debian unstable
Posts: 3

Rep: Reputation: 0
It might be an xauth problem. Does the user running the hotplug script have permission to use the X server? Do hotplug scripts just run as root? I guess in that case you'd need to xauth extract, then xauth merge while logged on as root.
 
  


Reply

Tags
hotplug, usbstorage


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
module not in action venkatesh111 Programming 1 03-23-2006 04:49 AM
Firmware/Hotplug problem with Hauppauge DEC2540-T, Hotplug and MythTV bezoomny Linux - Hardware 0 05-17-2004 01:37 PM
See CL in Action 2 Xterminator Conectiva 0 06-30-2003 10:14 AM
See CL 8 in action Xterminator Conectiva 1 09-26-2002 12:06 PM
Dumb action [2] :\ techplex Linux - Newbie 3 07-01-2002 05:20 PM


All times are GMT -5. The time now is 11:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration