General Computing
linux bash gnome-terminal
Updated Fri, 20 May 2022 14:21:14 GMT

Programmatically starting 6 servers and manipulating Gnome Terminal

I would like to make a script ( bash ) that will programmatically

  1. start gnome-termal with 6 tabs each with its own title
  2. start a different command in each tab
  3. delay starting server 5 until sever 4 has been running for about 1 minute
  4. change the title of the gnome terminal to "My Servers"
  5. switch tabs to the Server 4 tab

I would like to do all of this with double clicking on the file, without a dialog box ( RHEL 6 ) coming up to ask me if I want to display or run the file.

Googling around I got this far, but I could use some help with the rest:

gnome-terminal                                 \
--tab -t "Server 1"   -e commandStartServer1   \
--tab -t "Server 2"   -e commandStartServer2   \
--tab -t "Server 3"   -e commandStartServer3   \
--tab -t "Server 4"   -e commandStartServer4   \
--tab -t "Server 5"   -e commandStartServer5   \
--tab -t "Server 6"   -e commandStartServer6   \


I can just help you with the dialog box. Create a .desktop file, that will run you executable script. You can find a quick introduction to .desktop files here or take a look at one of the files in /usr/share/applications.

As for the rest of the questions please take a look at this question.

Comments (3)

  • +0 – That seems to have worked, at the second link you quoted what does the variable BASH_POST_RC mean? — Dec 31, 2014 at 05:08  
  • +0 – I successfully used the method at the second link you posted, thank you. I noticed that using that technique the command strings don't get put into the terminal or the history, just executed. Is there anyway to do that? — Dec 31, 2014 at 05:09  
  • +0 – if nothing else works, you could always add this command: echo 'command' >>~/.bash_history — Dec 31, 2014 at 07:53  

External Links

External links referenced by this document:

Linked Articles

Local articles referenced by this article: