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

Re: Hotplug running user scripts



On Tue, 28 Dec 2004 07:07 am, Bill Moseley wrote:
> This is more of a general X11/*nix question, I suppose.  When I plug
> in a USB device into my laptop I want hotplug to run a script as a
> specific user and I'd like to use GTK+ or Xdialog to prompt for some
> information.
>
> What I'm not sure of is how to determine the user's $DISPLAY.
>
> For example, when a USB camera is connected I'd like to pop up a dialog
> and ask if the user wants to transfer photos to their $HOME/photos
> directory.
>
> I realize there may be more than one $DISPLAY running.  And there can
> even be more than one set of display hardware on a given machine.  Not
> to mention my knowledge of running an X server is limited.  So I'm not
> clear how to accomplish this.
>
> Any suggestions?
>
>
> --
> Bill Moseley
> moseley@hank.org

Bill,

I usually try to find something similar to what I want to do and work out how 
it does it:)
In that spirit, look at:
http://www.gphoto.org/doc/manual/permissions-usb.html#setting-up-linux-hotplug
I use usbcam.x11-app to launch gtkam when I plug in our camera, but you can 
change it to whatever you want...all this should give you a good starting 
point:)

hth, r:)
-- 
Romana Branden
Sticks & stones may break my bones, 
but words can break my heart..
ITShare SA Inc - http://itshare.org.au/
ITShare SA gives away computer systems 
created from donated hardware and opensource software.

Attachment: pgpT0TsvbJ3gc.pgp
Description: PGP signature


Reply to: