Re: pop-up notices for all gnome users

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

 



Hi,

I couldn't find the shell variable that will give me
the user who is currently logged on to display :0.0.

My problem:

I need to display a pop-up message every .5 hours on a
computer no matter who is logged in.  I have a script
using zenity that will do the pop-up and if I log in
as myself and automate this script with cron, the
pop-up works fine, but only while I'm logged.  If I
try to add the same scipt to root's crontab then I get
errors.

This is the cron entry (set to run every minute for
testing):

* * * * * DISPLAY=:0.0 /path_to_my_script

This is the error:

X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(zenity:7245): Gtk-WARNING **: cannot open display:


So I need perhaps one of the following sollutions:
-a way to give root access to :0.0 regardless of who
is loggeg in?

-a way to add an entry to all user's personal crontab

-a way to determine (in my script) who is using
display :0.0 and then run the script as that user.


Any help is greatly appreciated.
--Paul



--- Oliver Leitner <shadow333@xxxxxxxxx> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>  
> yes, theres a shell variable that you may just read
> out, have a look
> with "set".
> 
> also theres who, finger, w
> 
> and prolly others....
> 
> Paul Keyes wrote:
> 
> | Is there a way to determine who is loggeg in
> (maybe with 'who'
> | command) and sitting at the terminal, so that I
> can run the script
> | as them?
> |
> | --Paul --- Oliver Leitner <shadow333@xxxxxxxxx>
> wrote:
> |
> 
> | easy answer:
> |
> | try to run your script as non root user, eg try
> sudo to run it.
> |
> | Greetings Oliver
> |
> | Paul Keyes wrote:
> |
> | | Thanks.  This is helpful.  I have a followup
> question: I want to
> | | schedule a zenity command via cron as root to
> have a window
> | appear | every 30 minutes for any user who may be
> loggeg in.  When
> | trying | this I get the cron error: | |
> X-Cron-Env: <SHELL=/bin/sh>
> | X-Cron-Env: <HOME=/root> X-Cron-Env: |
> <PATH=/usr/bin:/bin>
> | X-Cron-Env: <LOGNAME=root> X-Cron-Env: |
> <USER=root> | | |
> | (zenity:6093): Gtk-WARNING **: cannot open
> display: | | | Do you
> | know how to solve this? Thanks! | | | | | ---
> Esteban Xandri
> | <esteban.xandri@xxxxxxxxxxxxx> wrote: | |> On Mon,
> 2005-08-22 at
> | 15:55 -0400, Paul Keyes wrote: |> |>> Hi All, |>>
> |>> I need to
> | create a pop-up window notice to all |> |> users
> |> |>> when they
> | log in to their gnome desktop. |> |> man zenity |>
> |> |>> I'm using
> | Fedora Core 3 (kernel: 2.6.10-2.1.ll.rhfc3.ccrma).
> |> |>> Does
> | gnome have a way to do this already? I couldn't
> find one |>> so I
> | created my own little app (c++, gtk) to display
> the info |>> in a
> | window and I |> |> run |> |>> it for all users by
> adding an
> | appropriate entry to |>>
> /usr/share/gnome/default.session This
> | almost works, but for |>> some reason the gnome
> startup display
> | stays open and blocks my |>> window. |> |> If I |>
> |>> click on the
> | "stuck" gnome startup display it dissapears and I
> |>> can see my
> | window.  I think this little bug will confuse
> users. |>> Does
> | anyone know a |> |> way |> |>> around this/why the
> startup window
> | gets "stuck"? Any advice is |>> greatly
> appreciated. --Paul |>> |>>
> |  |>> |>> |>> |>> |
> |
> |>
>
__________________________________________________________
> |
> | | |>> Find your next car at http://autos.yahoo.ca
> |>> |> -- Esteban
> | Xandri <esteban.xandri@xxxxxxxxxxxxx> |> |> --
> fedora-list mailing
> | list fedora-list@xxxxxxxxxx To |> unsubscribe:
> | http://www.redhat.com/mailman/listinfo/fedora-list
> |> | | | | | |
> |
> |
> |>
>
__________________________________________________________
> |
> | Find | your next car at http://autos.yahoo.ca |
> |
> 
> - --
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe:
> http://www.redhat.com/mailman/listinfo/fedora-list
> 
> 
> 
> 
> 
> 
> 
> 
> |
>
__________________________________________________________
> Find
> | your next car at http://autos.yahoo.ca
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
>  
>
iD8DBQFDC3v4xHPquN24yVsRA9wUAKDX9rz0WNTv+r/v3FDuP4JKaNg0dgCg8K4x
> U9yBFGNJjjqlPeim7C2lNIg=
> =3YO0
> -----END PGP SIGNATURE-----
> 
> -- 
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe:
> http://www.redhat.com/mailman/listinfo/fedora-list
> 



	

	
		
__________________________________________________________ 
Find your next car at http://autos.yahoo.ca


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux