Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I created a new profile for gnome-terminal and I can switch between "Implicit" profile and the new created profile as you can see in the below image:

Switch between profiles in gnome-terminal

Now I wonder how can I switch between profiles using a command-line/script or maybe using a shortcut for this.

Note: Solutions like:

gnome-terminal --tab-with-profile=Implicit && exit 

are excluded because I prefer not to close and open another terminal or get another terminal window in this process of changing the profile.

share|improve this question
1  
With gconftool-2 you can set the profile whose changes are immediate . Have you checked this out-->stackoverflow.com/questions/660442/… –  Stormvirux Aug 7 '13 at 20:10
    
@Stormvirux No... So can you explain how to use gconftool or gconftool-2 to switch the profile? I don't see a good answer/explanation there. –  Radu Rădeanu Aug 7 '13 at 20:18
add comment

3 Answers

There is no shortcut that allows you to change the profile within the terminal (without navigating the menus as you said in comments), without the use of the GUI. Quoting the manual (stable, development 3.9):

You can change the profile in your current Terminal tab or window by selecting a profile from Terminal ▸ Change Profile.

(You can propose this as suggestion in the bug tracker)

share|improve this answer
    
Actually, there is a shortcut: Alt+T followed by P, Up Arrow or Down Arrow and Enter. But this is a little bit long... –  Radu Rădeanu Aug 7 '13 at 20:33
    
@RaduRădeanu Alt + T doesn't work in my terminal 3.8.3 :/ –  Braiam Aug 7 '13 at 20:49
1  
@RaduRădeanu I guess alt+t is in fact using the GUI, it's just not using mouse. –  moon.musick Aug 19 '13 at 20:10
    
@Braiam If you are using non-English version of the gnome-terminal, press alt and see what letter is being highlighted for your language version of 'Terminal' (it's 5th item in my Polish version, just left of 'Help'), then use that letter with alt. –  moon.musick Aug 19 '13 at 20:14
    
@moon.musick I'm using the Debian version of gnome-terminal 3.8.3, and seem that it doesn't have the Alt modifier to access the menus. –  Braiam Sep 9 '13 at 16:27
show 2 more comments
up vote 1 down vote accepted

To switch to the "implicit" profile:

xdotool key Alt+t p Return

To switch to the second profile:

xdotool key Alt+t p Down Return

xdotool Install xdotool is not installed by default in Ubuntu, so it must to be installed first.

Of course, for these commands can be added custom keyboard shortcuts.

share|improve this answer
    
That's not a shortcut. You are only simulating the keypresses, is only mnemonics of the application. –  Braiam Nov 14 '13 at 18:44
1  
@Braiam Yes, it's not a shortcut, I can see. It's a command-line (see man xdotool for more info) as I asked, which is working exactly as I wish and I am happy with this answer until something better will appear. ;) –  Radu Rădeanu Nov 14 '13 at 18:58
    
You seriously should consider suggesting that in the bugtracker... –  Braiam Nov 14 '13 at 19:00
    
@Braiam As I told you, I'm ok with this solution, it's working like a charm. Regarding your suggestion, there is one in this sense from 2002 (modified in 2010: "It would be extra nice if I can use exactly two keystrokes to open the profile of my choice." - see this comment). So, why do you think that I should add a new one? Do you like duplicates? –  Radu Rădeanu Nov 14 '13 at 20:49
add comment

Depending on your purpose, you may find this script to be useful: https://github.com/xyrix/gnome-terminal-profile-switcher

It does a sort of monkey patch and generates a new profile for each terminal, then sets some environment variables to expose a program for switching the theme of the profile for your current terminal.

Hopefully the example safe_ssh script will make things clear :-). I've been using it for just over a year now and it's helped me not destroy the company's live database ^_^

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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