Hi Tim,
The only way I could make it work without meddling with xauth was to
run the zenity command as the user whose X session it is (using sudo)
which menas you have to know which user is using which machine. If
your machines are dedicated to individuals, you could just hard code
their usernames into a script, but if different users use different
machines you have to fetch the username before issuing the command,
which gets more difficult; you can do this using drbl-doit to issue
the "who" command to a certain host, then pick out the username with a
regex: \D(\d{6})\D
In my case it was relatively easy as I had the necessary variables
already as part of a bigger web-based app that I have had programmed,
but my needs are different (I need to pop up messages on certain
machines at certain times, rather than a single message to all
machines at once). However, I'm convinced that there must be an easier
way of doing what you want. Look into "X11Forwarding yes" in your
/etc/sshconfig and check how xauth works (careful of security
issues!). This conversation will probably get you there:
http://www.nabble.com/Zenity-pop-up-on-remote-desktop-td22478863.htmlGood luck!
Graham
> Message: 4
> Date: Thu, 17 Sep 2009 08:39:16 +0000
> From: Tim Shelley <
tim_j_shelley@...>
> Subject: Re: [Drbl-user] Is there a way to display a message on the
> clients?
> To: <
drbl-user@...>
> Message-ID: <
BAY113-W551D0BAF39919E05699CBB7E10@...>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Hi Graham,
>
> Thanks for the info.
>
> I'm going to play with this to see if I can figure out a way of sending out a visual message to all clients on our DRBL network, telling any open clients to say logout as the server will be rebooting in 10 minutes etc...
>
> If I understand how you are doing it, each user needs to be part of sudo so that you can run 'sudo -u $account /usr/bin/msg' on the client? I'm guessing that the msg script will not run correctly without running it as sudo?
>
> Regards,
>
> Tim
>
> From:
gdi2k@...
> Date: Thu, 17 Sep 2009 08:05:56 +0800
> To:
drbl-user@...
> Subject: Re: [Drbl-user] Is there a way to display a message on the clients?
>
> Hi Tim / Jazz,
>
> I do this successfully by using a script which I execute with:
>
> sudo /opt/drbl/bin/drbl-doit -h "$ipaddr" sudo -u $account /usr/bin/msg
>
> where $ipaddr is the IP address of the PC and $account is the username of the user on the PC to whom the message is being sent.
>
> The script (/usr/bin/msg) is as follows:
>
> #!/bin/bash
>
> export DISPLAY=:0
> zenity --warning --text="Your message goes here!"
>
> In my case this runs from a web-based application (user www-data on Debian / Ubuntu), so I had to modify the sudoers file to avoid the password prompt on execution (reduction in security!).
>
> I was not able to get this working without putting everything into a script as above.
>
> Hope that helps...
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf_______________________________________________
Drbl-user mailing list
Drbl-user@...
https://lists.sourceforge.net/lists/listinfo/drbl-user