Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you just want fortune to run when you open a terminal, I'd suggest putting the call to fortune in your .bashrc, rather than in your menu. Every time you open a terminal, your .bashrc is run anew for that particular instance of the terminal.
That way your fluxbox menu entry is just [exec] (terminal) {gnome-terminal}, and fortune will run itself each time you open it.
Code:
[me@localhost ~]$ cat .bashrc
export PATH=$PATH:/usr/sbin/:/home/laura/OpenOffice.org1.1.0/program:/usr/gnat/bin:/usr/java/jdk1.3.1_07/bin/
export PYTHONPATH=/usr/local/lib/python2.2/site-packages/gtk-2.0/:/usr/local/lib/python2.2/site-packages/
#aliases
alias ls="ls --color"
alias ll="ls -l"
alias umount="sudo umount"
alias mount="sudo mount"
alias shutdown="sudo /sbin/shutdown"
#Customize bash prompt to look human...
PS1="[\u@\h \w]\\$ "
#The last thing in the file
echo "What is your command, my mistress?"
<--- put 'fortune' in here somewhere
(The other option, if you're intent on doing it the way you've got set up, is *maybe* to add a '&': {gnome-terminal -e fortune &} ...but I'm not sure that'll work. It may not even bring up the window that way)
Last edited by rose_bud4201; 07-26-2005 at 08:31 PM.
Originally posted by rose_bud4201 If you just want fortune to run when you open a terminal, I'd suggest putting the call to fortune in your .bashrc, rather than in your menu. Every time you open a terminal, your .bashrc is run anew for that particular instance of the terminal.
That way your fluxbox menu entry is just [exec] (terminal) {gnome-terminal}, and fortune will run itself each time you open it.
(The other option, if you're intent on doing it the way you've got set up, is *maybe* to add a '&': {gnome-terminal -e fortune &} ...but I'm not sure that'll work. It may not even bring up the window that way)
Thanks for your help, but I'd want a way to keep the console up after a command is completed. I have several other programs that will exit after they are finished and would like to find a way to keep it up.
From all I've seen on Google and trying this myself, you can't do what you want...rxvt just ain't gonna make it happen. If you want a terminal to stay up after you run a program, open rxvt through your menu, and then run whatever program it is you want to run.
Originally posted by rose_bud4201 From all I've seen on Google and trying this myself, you can't do what you want...rxvt just ain't gonna make it happen. If you want a terminal to stay up after you run a program, open rxvt through your menu, and then run whatever program it is you want to run.
Fortune is a simple program designed to display text in your terminal or console, when it displays the random text, it's done. By running in a terminal, it's going to close which is not either the terminal's issue or fortune, it's just how it works. Fortune was not intended to run by a X menu or icon but rather for messages when you login, etc.
My suggestion would be if you really want to be able to click on 'fortune' and read it by the terminal window staying open long enough, write a simple script that calls fortune and then perhaps sleeps for however long you want it to stay open for, which will cause the terminal to stay open for however many seconds you set it to...
I did a test and it worked.. the script would be as followed for you:
Code:
#!/bin/bash
# Script to make the terminal stay open long enough to read the fortune
gnome-terminal -e fortune
# Sleep for 2 minutes so I can read the fortune
sleep 120
Then just name this script whatever you want and place in /usr/bin or whereever and edit your menu to point to this script instead of the gnome-terminal -e fortune portion... so it would look like this:
[exec] (fortune) {/path/to/new/script}
And come to think of it, you could probably just add the sleep portion at the end of your existing fortune link in the menu like this:
Why can't you just have a menu option that opens a terminal, and then just run the command that you want to run? Since you want the terminal to remain active anyway, it can't be that you don't like using the commandline....? The menu won't save you that much time in the long run, really it won't.
If they're complicated program names, or have long options and so on, you could always just set up an alias for them.
in .bashrc:
alias short_cut="long_winded_program_name -with -lots -of -options"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.