0

I'm trying to open 2 terminals on startup. One will execute one command, and the other one will execute a different command.

I already tried using Ubuntu's Startup Applications program pointing to scripts that only executed these commands. They were executable and worked fine but this didn't work for opening them on startup. I also tried creating systemd services for them, but that didn't work either.

What am I doing wrong? Any suggestions? Also, if I'm using i3 will the screen split automatically with these terminals? Thanks in advance.

1 Answer 1

0

To have a terminal command open in a terminal, specify "Terminal=true" in the desktop file, for example:

[Desktop Entry]
Name=Top
Exec=top
Terminal=true
Type=Application

This will open top in your default terminal emulator. Once you quit top, the terminal will close.

If you want to leave the terminal open when the command you run finishes, then you can call bash after it, as in:

Exec=sh -c 'ls ; bash'

This will run the ls command, then give you a terminal prompt.

Place the .desktop file in the .config/autostart folder to have it run automatically when you log in.

2
  • Thanks! Should the .desktop file be located at ~/.local/share/applications/? Do i need to do anything else after? May 1, 2021 at 11:44
  • I added a sentence on where to put the launcher in order to have it autostart.
    – vanadium
    May 1, 2021 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.