Ubuntu – How to open one (or more) gnome-terminal window with few tabs, each with different profile, when start/reboot the computer

16.04command lineconfigurationgnome-terminaltabs

I have several profile for terminal. I can open all profiles on boot but they open in different windows with this cmd in startup applications:

gnome-terminal --window-with-profile=ablack && gnome-terminal --window-with-profile=agreeen && gnome-terminal --window-with-profile=aubergine && gnome-terminal --window-with-profile=beige && gnome-terminal --window-with-profile=cyan && gnome-terminal --window-with-profile=grey && gnome-terminal --window-with-profile=orange && gnome-terminal --window-with-profile=white && gnome-terminal --window-with-profile=yellow && gnome-terminal --window-with-profile=ablack    

I tried to open one window with several tabs with this cmd without success:

gnome-terminal --window-with-profile=ablack && gnome-terminal --tab-with-profile=agreeen && gnome-terminal --tab-with-profile=aubergine && gnome-terminal --tab-with-profile=beige && gnome-terminal --tab-with-profile=cyan && gnome-terminal --tab-with-profile=grey && gnome-terminal --tab-with-profile=orange && gnome-terminal --tab-with-profile=white && gnome-terminal --tab-with-profile=yellow && gnome-terminal --tab-with-profile=ablack   

How to make it work?

Best Answer

  • To open a gnome-terminal window with few tabs we should use the option --tab. See gnome-terminal --help-all. Also in man gnome-terminal we can find this explanation:

    --window-with-profile=PROFILENAME
         Open a new window containing a tab with the given profile. 
         More than one of these options can be provided.
    --tab-with-profile=PROFILENAME
         Open a tab in the window with the given profile. 
         More than one of these options can be provided, to open several tabs.
    

    So, to open gnome-terminal window with few tabs, we should use command as this one:

    gnome-terminal --tab-with-profile=ProfileA --tab-with-profile=ProfileB --tab-with-profile=ProfileC
    

    Compose your own command and test it into a terminal. If it works satisfactorily add it as an entry in Startup Applications:

    enter image description here

    There are few possible approaches how to open few gnome-terminal windows with few tabs in each. I would suggest to use a command as follow:

    gnome-terminal --tab-with-profile=ProfileA --tab-with-profile=ProfileB && gnome-terminal --tab-with-profile=ProfileC --tab-with-profile=ProfileD
    

    Another idea is to create separate Startup Applications entry for each gnome-terminal window.