Make gnome-terminal profiles work for you

Jack Wallen
Jul 18, 2010
Updated • Dec 5, 2012
Linux
|
6

The gnome-terminal is one of the finest terminals available for the Linux operating system. It's rock-solid, does it's job, and has a ton of features you might not find in other terminal emulators. One of those features is the Profile. A profile is a way to have multiple terminal configurations at once. You can create as many as you like and switch back and forth on the fly. But why have this feature? Is it really necessary? I can show you a few reasons why the gnome-terminal profile offers you multiple profiles.

In this article I will walk you through the creation of new profiles and show you why you might want them.

Assumptions

First and foremost, this article assumes you actually use the terminal and assumes you use it a lot. The pedestrian user of the terminal might not see a need for multiple profiles for a terminal window. But if you use the terminal a lot, and for various reasons, you might see how multiple profiles can make a difference.

Creating new profiles

Figure 1

Let us first take a look at how profiles are created. To create (or edit) a profile click Edit > Profiles. This will bring up a new window (see Figure 1) where you can add, edit, or delete profiles at will.

As you can see, in Figure 1, I have two current profiles - default and "no trans". My default profile fits in with my current desktop scheme (RGBA, with heavy transparency). There are times when I need to more closely evaluate text (such as when viewing top or combing through a configuration file. For those times I switch to the "no trans" profile which is a non-transparent profile I created.

To create a new profile click the New button. When you do this a small window will open where you give your new profile a name and choose which of your current profiles to base the new profile on. Let's say, for the sake of example, I want to create a profile for any time I am using the terminal as the root user. This can come in very handy (and keep you from doing something you don't want to do).  For this I am going to call the profile "Root" and base it on "no trans". Once you've done that the main profile editor window will appear (see Figure 2) .

In this new window you can change quite a bit for your profile. For a profile to work as the administrative user you might want to do something like create a white background with red text, or a red background with black text. For such an instance I like to alter the Title and command to ensure there is no mistaking I am using the administrative user. To do this click on the Title and Command tab and then change the Initial title to be something like ROOT User: USE CAUTION. You can then select to prepend this title if the terminal command sends it's own title (which is often the case).

Figure 3

The new "root" profile will look something like that in Figure 3.

Switching profiles

This is simple, and can be done on the fly. All you need to do is click Terminal > Change Profile and select the profile you want.

Final thoughts

Make use of the gnome-terminal profiles and your life will be much easier. There are a lot of reasons why you would want to use them and tons of modifications you can make to them.

Advertisement

Previous Post: «
Next Post: «

Comments

  1. Rob said on July 19, 2010 at 3:08 pm
    Reply

    One thing I like to do is have my shell prompt change based on what user I am; I change user by ‘sudo -s -u root’ for example. Adding the following to your .bashrc file will make your username@host green when you’re user 1000 (me), red when you are root, and blue when you’re anyone else.

    USER_ID=`id -u`
    if [ “$USER_ID” == “0” ]; then
    BEGIN_ROOT=”\[33[01;31m\]”
    elif [ “$USER_ID” == “1000” ]; then
    BEGIN_ROOT=”\[33[01;32m\]”
    else
    BEGIN_ROOT=”\[33[01;34m\]”
    fi

    END_ROOT=”\[33[00m\]”
    PS1=”${debian_chroot:+($debian_chroot)}$BEGIN_ROOT\u@\h:$END_ROOT\w\$ “

  2. Simon Moon said on July 18, 2010 at 5:19 pm
    Reply

    One thing you cannot change: gnome-terminal sets TERM=xterm always and forever more.

    # .bashrc
    # force 256 color gnome-terminal terminfo
    if [[ TERM==”xterm” && COLORTERM==gnome* ]]; then
    export TERM=”gnome-256color”
    fi

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.