LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   automatically open a terminal after boot (https://www.linuxquestions.org/questions/linux-newbie-8/automatically-open-a-terminal-after-boot-4175483720/)

khum 11-07-2013 05:53 AM

automatically open a terminal after boot
 
Hi everybody. I'm pretty new to the fascinating Linux world and just signed in :) I'm running CentOs and doing some tests.

Currently, when I boot the machine, the login screen appears.
I would like to automatically login the machine as a certain user (without login screen) and automatically open a terminal. How to do that?
Second step would be running automatically a script in that terminal (e.g. a simple "echo Welcome!") so that the final result would be booting the machine and (after boot completed) appearing over the desktop a terminal showing something like
Welcome!
$

any suggestion would be greatly appreciated
Cheers,
kh

piquezino 11-07-2013 06:01 AM

Hello !
Try this solution

If you want the "Welcome", edit /etc/motd

khum 11-07-2013 07:11 AM

Thanks for the answer.
Solution linked refers to CLI mode, I would like to still access GUI mode (a terminal over the desktop), is that possible?

druuna 11-07-2013 07:46 AM

@khum: I'm assuming your DM is Gnome:

To automatically log in modify the /etc/gdm/custom.conf, add to the
[daemon] section the following:

AutomaticLoginEnable=True
AutomaticLogin=username


Replace username with the actual user name.


Starting a terminal: System -> Preferences -> Startup Applications (or Sessions not sure which one is used on CentOS), click on add and enter gnome-terminal in the command box.

You can also fill in the full path to a script in the command box.


A welcome message can be done in several ways. Here's one using the users .bashrc file: Add echo "Welcome!" to the bottom.

khum 01-09-2014 12:12 PM

druuna thanks a lot! It did work! And btw the welcome message was just an example :)

Sorry to answer so late but hadn't chance to test it earlier.

Last question: which file contains info on the command gnome-terminal entered in the session box?

druuna 01-09-2014 12:34 PM

Quote:

Originally Posted by khum (Post 5095026)
druuna thanks a lot!

You're welcome ;)

Quote:

Originally Posted by khum
Last question: which file contains info on the command gnome-terminal entered in the session box?

gnome-terminal has a manual page (man gnome-terminal)

BTW: gnome-terminal was just an example, you can use just about any command/program. Another example you can put in the command box: /usr/bin/firefox

khum 01-09-2014 02:58 PM

I realize I wasn't clear at all (my fault, sorry :D)
I meant, when I configure via GUI this startup command, which is the configuration file containing this information?
I expected something like rc.local...

suicidaleggroll 01-09-2014 03:39 PM

I believe it's usually in ~/.config/autostart

khum 01-10-2014 07:38 AM

Quote:

Originally Posted by suicidaleggroll (Post 5095128)
I believe it's usually in ~/.config/autostart

you're right thanks a lot


All times are GMT -5. The time now is 10:48 PM.