View Full Version : how to popup message on login?

29th March 2009, 10:05 PM
Short version: How do I popup a random fortune message each time I login in gnome? Something similar to the "leave message" function when I lock the screen?

Long version: Ok, ever since I noticed the fortune program's help had a line that said I could add the program to the ".login" file, so that a message would come each time someone logged in, I did a lot of research and concluded:
1) Fedora, afaik, doesn't have a ".login" file. But we can instead use the ".bash_profile" for this purpose.
2) It just works if you login from the terminal.
How do I do this with the graphical login? I like the popup that comes when someone leaves a message at a locked screen.. Can we do something similar?

29th March 2009, 10:14 PM
If this was my goal, I would:

1) create a text file containing the 'fortune' sayings. One per line.
2) write a bash script that utilizes zenity to pop up a message onscreen, pulling one line of text in some random fashion from the 'sayings' file.
3) set that bash script as an application to auto-launch in the session preferences.

I have several custom bash scripts that make good use of zenity to do all sorts of things.

29th March 2009, 11:32 PM
You could also use xmessage, which is part of the xorg-x11-apps package.
As far as having it run when logging in to GNOME, it's been a while since I've used GNOME but I seem to recall some setting for startup programs somewhere in the GNOME config GUI. I know it's easy to do in WindowMaker, which is what I use. :)