Open a Terminal and run a program after Gnome boot.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
After FC6 boots, I would like to open a Terminal window on the GUI desktop and then run a text application in that window.
I can open a terminal window by placing an xterm command into Startup:
System > Prefs > More Prefs > Sessions > Startup > add xterm
That works. (There are probably more elegant ways to do this)
Then I should be able to follow xterm by the program I want.
Suppose I want to run "cal" after the terminal is opened. Then I might use the following command in Startup:
xterm && cal
or xterm && ./usr/bin/cal
However, the above two lines don't work for me in Startup.
Any thoughts on how to automatically start a program in the opened Terminal window?
Thank you.
I work in terminal windows all the time from within Gnome. Seeing how I cut my teeth on the command line, it's no biggy for me after all. I have an icon on my desktop to open; Xterm, Xterm with root privileges, or I can right click on the Gnome desktop background, and the context menu which opens will have an "open terminal" command. Once in the terminal of choice I can run any command including programs that need the GUI. Note that if you run a prog that opens a separate window, then that new window is tied to the terminal session, if you close the terminal the other window will be killed too, and the terminal window will be stuck while the other program is running, you will get your prompt back when you close the program.
Last edited by jonnycando; 01-02-2007 at 04:39 PM.
Reason: add more thoughts
what happens at boot is that a Terminal window opens only for a fraction of a second (can't tell if I can see cal), and then the Gnome GUI Desktop appears.
The xterm Terminal does not persist on the Desktop.
If I run xterm alone, a terminal appears on the Gnome desktop and stays there.
The basic idea is that xterm runs a program and when program ends, it also ends. cal is not an interactive program so it ends just after calendar is displayed, so you need another program to tell xterm that there is still something to do.
You could write a sript running infinite loop, so you won't have to run bash, for example. Or you could right a very small application which will ask for input, almost emulating system idle process.
Here is the code:
Code:
#include <stdio.h>
int main() {
int i;
scanf("%d", &i);
return 0;
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.