I assume you're using the default Ubuntu flavor so you have gnome-terminal
as your terminal emulator.
To run an executable that outputs to the terminal at startup, you can create a myapp.desktop
file in ~/.config/autostart
containing the following lines:
[Desktop Entry]
Type=Application
Exec=gnome-terminal -e /home/<username>/myproject/build/myapp
Hidden=false
NoDisplay=false
X-GNOME-Autostart-Enabled=true
Name=myapp
Comment=My awesome video streaming app.
Don't forget to change <username>
with the actual value of your UNIX username, which you can get by running whoami
in a terminal window.
The most important lines in this .desktop
file are the Exec
line (the command line of the program to run) and the X-GNOME-Autostart-Enabled
line (whether it runs at startup or not). It launches a terminal window (gnome-terminal -e
) and runs your compiled app. You can customize the lines beginning with Name
and Comment
to your liking.