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 |
I think use the --display argument eg. 'nautilus --display :0.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.
|
All times are GMT -5. The time now is 01:46 PM. |