0

I want to have the gnome-terminal autostart and run a single line like echo "Hello World", after the user is logged in. Ubuntu automatically logs in the user. What is the best way to achieve this?

Tried to add gnome-terminal to the list of startprograms, but can't seem to add any additional commands. gnome-terminal -- 'echo "Hello World"' opens an empty terminal, but doesn't run the code.

1 Answers1

0

To launch the terminal when a user logs in:

To launch for one user: copy /usr/share/applications/org.gnome.Terminal.desktop to ~/.config/autostart

To launch for all users on the system: copy /usr/share/applications/org.gnome.Terminal.desktop /etc/xdg/autostart/

This part may work, but I am unclear what the purpose of the output to the terminal will be.

To echo something out simply add whatever it is to the last line of the .bashrc, if you want it to only launch once per day you may need to get a little clever and set a "seen" file and test the date to see if has been seen once today for that user and if so don't show it again if not, update the "seen" file to set the new date.

If you want it for all users you will have to put a skeleton bashrc in /etc/skel but the code could be the same.