[lug] Graphical clickable motd

Hugh Brown hugh at math.byu.edu
Fri Apr 8 08:24:43 MDT 2005


> > > > I've get a system set up that is using the NoMachine software (kind of
> > > > cool actually), and need to set up a motd for gnome and kde to tell people
> > > > not to do compute intensive stuff on the terminal server.  I'd like the
> > > > motd/notice to be a little gui window with an OK button that pops up
> > > > everytime gnome/kde is started.
> > > >
> > > > A quick and dirty would be to modify the splash screen, but it wouldn't
> > > > force the users to acknowledge it.  Does anyone have any ideas about how
> > > > to tie in to the gnome/kde session start up process?
> > >
> > > Once you figure out where to run the script, you can easily put up
> > > popup windows with xmessage.  For more complex stuff it looks like
> > > Xdialog will work.  I know there is a KDE specific variation, but I
> > > can't recall the name.  I'd be surprised if there weren't a GNOME
> > > version, too.
> > >
> > > For a single user you can just put it in ~/.kde/Autostart, but they
> > > can always delete it.  I'm not sure how you add it to all startups.
> > >
> > > Michael
> >
> > I need something they can't delete.  I think xmessage was the quick
> > thing I was looking for.  Unfortunately, when the users are logging in,
> > they aren't using {x,g,k}dm.  The NoMachine client calls gnome-session
> > or startkde directly.  Some research seems to indicate that I can tie in
> > to the splash screen start up for both Gnome and KDE
> > (/usr/share/gnome/default-session for GNOME and dropping a .desktop file
> > in /usr/share/autostart/ for KDE).
>
> In that case use xmessage in the .desktop for for KDE and the file for
> GNOME.  Not need to do anything fancier.
>
> Michael


A little report on what I found (if anyone cares):

Gnome:
You are supposed to add your application to
/usr/share/gnome/default.session   The file is self-documenting as to
format.  However, your application is supposed to speak XSMP and if it
doesn't the session manager will wait for it to register with the session
for a configurable amount of time (Gnome default is 10 seconds).  Since my
little perl script has no idea how to speak XSMP, I get some weird
behavior when it is used via the nomachine client.  Namely, certain
applets don't work until after another function is done (e.g. clicking the
logout button doesn't do anything until after I try and start a shell from
the panel).

Additionally, if a user has saved their session,
/usr/share/gnome/default.session is ignored.  So, to get the message to
pop up for all users, I had to put a wrapper around the gnome-session
binary.

KDE:
KDE was remarkably easy.  I added a motd.desktop file that had the script
as its command and put the motd.desktop file in /usr/share/autostart and
it worked fine.

As for the pop-up, perl and Gtk worked fine (I used the tutorial at
http://www-zeuthen.desy.de/computing/documentation/perl/gtkperl-tutorial/).

Hugh



More information about the LUG mailing list