[wplug] Creating an xmessage box from a hotplug script

Eric Cooper ecc at cmu.edu
Fri Feb 24 16:17:39 EST 2006


On Fri, Feb 24, 2006 at 02:04:58PM -0500, Brandon Kuczenski wrote:
> I have a script that runs upon detecting certain hotplug events. 
> Naturally, it runs as root.  I would like this script to generate a 
> user-input window using xmessage on the "currently active" X display, if 
> such a thing is possible.

If this is a workstation, where you can reasonably assume that the
user's display will always be :0, you can just override X access
control for local processes, by using
    xhost +local:
(perhaps in the system's /etc/X11/Xsession scripts)

Then "xmessage -display :0 ..." will work from any script.

(BTW, check out zenity, a prettier and more versatile replacement for
xmessage.)

-- 
Eric Cooper             e c c @ c m u . e d u


More information about the wplug mailing list