linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How can I bring up a dialogue window when a usb device plugged?
@ 2009-05-11 21:28 Andy Chen
  2009-05-11 21:43 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andy Chen @ 2009-05-11 21:28 UTC (permalink / raw)
  To: linux-hotplug


Hi There,

I need someone kind help on config udev module for auto pop up dialogue window when device plugged via the rule define.
Here is simple rules I defined but not working. Can someone point out what should be for the proper setting:

ACTION="add", SUBSYSTEM="usb", ATTR{idVendor}="04b4", ATTR{idProduct}="1004", RUN+="Xdialog --title "INFO BOX"& "

Thanks advice for your feedback,
Andy

_________________________________________________________________
One at a time or all at once? Get updates from your friends in one place.
http://go.microsoft.com/?linkid–60827

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

* Re: How can I bring up a dialogue window when a usb device plugged?
  2009-05-11 21:28 How can I bring up a dialogue window when a usb device plugged? Andy Chen
@ 2009-05-11 21:43 ` Greg KH
  2009-05-11 22:53 ` Andy Chen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-05-11 21:43 UTC (permalink / raw)
  To: linux-hotplug

On Mon, May 11, 2009 at 02:28:32PM -0700, Andy Chen wrote:
> 
> Hi There,
> 
> I need someone kind help on config udev module for auto pop up
> dialogue window when device plugged via the rule define.  Here is
> simple rules I defined but not working. Can someone point out what
> should be for the proper setting:
> 
> ACTION="add", SUBSYSTEM="usb", ATTR{idVendor}="04b4", ATTR{idProduct}="1004", RUN+="Xdialog --title "INFO BOX"& "

This will not work as you do not have a x session from this context.

Try writing a program that either ties into libudev to catch these kinds
of events, or uses dbus to watch for HAL events.  Then you can create
your own dialog box when specific devices show up as you wish.

Hope this helps,

greg k-h

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

* RE: How can I bring up a dialogue window when a usb device plugged?
  2009-05-11 21:28 How can I bring up a dialogue window when a usb device plugged? Andy Chen
  2009-05-11 21:43 ` Greg KH
@ 2009-05-11 22:53 ` Andy Chen
  2009-05-11 22:54 ` Greg KH
  2009-05-11 23:03 ` Andy Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Andy Chen @ 2009-05-11 22:53 UTC (permalink / raw)
  To: linux-hotplug


Hi Greg,
 
Thanks for the advice.
 
For the mechanism you mentioned, does it mean that I should create a daemon with libudev to keep on tracking the event coming out and bringing the gui window from there?
Is it the method employed in current kernel for the file explore auto pop up when usb hard drive plug in?

 
Thanks,
Andy 
----------------------------------------
> Date: Mon, 11 May 2009 14:43:15 -0700
> From: greg@kroah.com
> To: andychen_ca@hotmail.com
> CC: linux-hotplug@vger.kernel.org
> Subject: Re: How can I bring up a dialogue window when a usb device plugged?
>
> On Mon, May 11, 2009 at 02:28:32PM -0700, Andy Chen wrote:
>>
>> Hi There,
>>
>> I need someone kind help on config udev module for auto pop up
>> dialogue window when device plugged via the rule define. Here is
>> simple rules I defined but not working. Can someone point out what
>> should be for the proper setting:
>>
>> ACTION="add", SUBSYSTEM="usb", ATTR{idVendor}="04b4", ATTR{idProduct}="1004", RUN+="Xdialog --title "INFO BOX"& "
>
> This will not work as you do not have a x session from this context.
>
> Try writing a program that either ties into libudev to catch these kinds
> of events, or uses dbus to watch for HAL events. Then you can create
> your own dialog box when specific devices show up as you wish.
>
> Hope this helps,
>
> greg k-h

_________________________________________________________________
Create a cool, new character for your Windows Live™ Messenger. 
http://go.microsoft.com/?linkid–56621

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

* Re: How can I bring up a dialogue window when a usb device plugged?
  2009-05-11 21:28 How can I bring up a dialogue window when a usb device plugged? Andy Chen
  2009-05-11 21:43 ` Greg KH
  2009-05-11 22:53 ` Andy Chen
@ 2009-05-11 22:54 ` Greg KH
  2009-05-11 23:03 ` Andy Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-05-11 22:54 UTC (permalink / raw)
  To: linux-hotplug

On Mon, May 11, 2009 at 03:53:52PM -0700, Andy Chen wrote:
> 
> Hi Greg,
>  
> Thanks for the advice.
>  
> For the mechanism you mentioned, does it mean that I should create a
> daemon with libudev to keep on tracking the event coming out and
> bringing the gui window from there?

Yes.

> Is it the method employed in current kernel for the file explore auto
> pop up when usb hard drive plug in?

The kernel does no such thing, that is up to the desktop infrastructure.
I think Gnome uses HAL and dbus to do this currently, KDE uses much the
same thing as well.  I suggest you go look at their code if you have
questions.

good luck,

greg k-h

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

* RE: How can I bring up a dialogue window when a usb device plugged?
  2009-05-11 21:28 How can I bring up a dialogue window when a usb device plugged? Andy Chen
                   ` (2 preceding siblings ...)
  2009-05-11 22:54 ` Greg KH
@ 2009-05-11 23:03 ` Andy Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Andy Chen @ 2009-05-11 23:03 UTC (permalink / raw)
  To: linux-hotplug


I will.
Thanks so much for your feedback.

Andy
----------------------------------------
> Date: Mon, 11 May 2009 15:54:48 -0700
> From: greg@kroah.com
> To: andychen_ca@hotmail.com
> CC: linux-hotplug@vger.kernel.org
> Subject: Re: How can I bring up a dialogue window when a usb device plugged?
>
> On Mon, May 11, 2009 at 03:53:52PM -0700, Andy Chen wrote:
>>
>> Hi Greg,
>>
>> Thanks for the advice.
>>
>> For the mechanism you mentioned, does it mean that I should create a
>> daemon with libudev to keep on tracking the event coming out and
>> bringing the gui window from there?
>
> Yes.
>
>> Is it the method employed in current kernel for the file explore auto
>> pop up when usb hard drive plug in?
>
> The kernel does no such thing, that is up to the desktop infrastructure.
> I think Gnome uses HAL and dbus to do this currently, KDE uses much the
> same thing as well. I suggest you go look at their code if you have
> questions.
>
> good luck,
>
> greg k-h

_________________________________________________________________
Create a cool, new character for your Windows Live™ Messenger. 
http://go.microsoft.com/?linkid–56621

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

end of thread, other threads:[~2009-05-11 23:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11 21:28 How can I bring up a dialogue window when a usb device plugged? Andy Chen
2009-05-11 21:43 ` Greg KH
2009-05-11 22:53 ` Andy Chen
2009-05-11 22:54 ` Greg KH
2009-05-11 23:03 ` Andy Chen

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).