tags:

views:

5805

answers:

5

I'm using Gnome terminal and I want to change the background color or the profile through a command so I can group some commands in an alias to visually differentiate my windows when I run certain processes. I'm running Ubuntu, and bash is my shell. Are there commands in to do this?

A: 

I used to do this with command line arguments to xterm. I set up my .olvwm (am I dating myself) to execute 4 xterms with different background colours.

Paul Tomblin
+1  A: 

Assuming you know what profile you want before you open your terminal:

Right-click on your Panel and "Add to Panel" and add a custom application launcher

You can define position, size and profile (which takes care of colours, fonts, etc)

gnome-terminal --hide-menubar --geometry 115x40+0+0
gnome-terminal --window-with-profile=logs --hide-menubar --geometry=144x15+0-55

"man gnome-terminal" has lots of useful information

Ken
A: 

You want to use gconftool.

Gnome holds its settings in a hierarchy similar to the Windows Registry. Once you know the path to the item you want to change you can set that item's value with gconftool from the command line.

Use gconf-editor to browse through the Gnome settings.
Use gconftool to set the value of an item in your script.

In your case, you want to do the following:

gconftool --type string --set /desktop/gnome/background/primary_color "#dadab0b08282"

Obviously you'll want to replace that color value with whatever color you want.

I think he meant the gnome-terminal background
Octaflop
A: 

I looked into it and it turns out this is not possible. I filed bug: http://bugzilla.gnome.org/show_bug.cgi?id=569869

gconftool-2 can get/set profile properties, but there is no way to script an existing, open gnome-terminal.

Kai
+3  A: 

you can use setterm like this

setterm -term linux -back blue -fore white -clear
Zeograd