I would like to setup my gnome terminal's background(#002b36) and foreground color in ubuntu 13, using bash script.I tried gconftool but couldn't succeed.GCONFTOOL-2(1)                  User Commands                                                    GCONFTOOL-2(1)NAME       gconftool-2 - GNOME configuration toolMy gnome terminal version is $ gnome-terminal --versionGNOME Terminal 3.6.1Currently I'm using ubuntu terminal preferences UI to achieve this.
set gnome terminal background/text color from bash script
bash;terminal;colors;gnome terminal;dconf
Method #1 - Using dconfBackgroundYou can use the dconf tool to accomplish this, however it's a mult-step process. DESCRIPTION       The dconf program can perform various operations on a dconf database,        such as reading or writing individual values or entire directories.       This tool operates directly on the dconf database and does not read        gsettings schema information.Therefore, it cannot perform type and        consistency checks on values. The gsettings(1) utility is an        alternative if such checks are needed.Usage$ dconferror: no command specifiedUsage:  dconf COMMAND [ARGS...]Commands:  help              Show this information  read              Read the value of a key  list              List the contents of a dir  write             Change the value of a key  reset             Reset the value of a key or dir  update            Update the system databases  watch             Watch a path for changes  dump              Dump an entire subpath to stdout  load              Populate a subpath from stdinUse 'dconf help COMMAND' to get detailed help.General approachFirst you'll need to get a list of your gnome-terminal profiles. $ dconf list /org/gnome/terminal/legacy/profiles:/<profile id>Using this <profile id> you can then get a list of configurable settings$ dconf list /org/gnome/terminal/legacy/profiles:/<profile id>background-colordefault-size-columnsuse-theme-colorsuse-custom-default-sizeforeground-coloruse-system-fontfontYou can then read the current colors of either the foreground or backgroundforeground$ dconf read /org/gnome/terminal/legacy/profiles:/<profile id>/foreground-color'rgb(255,255,255)'background$ dconf read /org/gnome/terminal/legacy/profiles:/<profile id>/background-color'rgb(0,0,0)'You can change the colors as wellforeground$ dconf write /org/gnome/terminal/legacy/profiles:/<profile id>/foreground-color 'rgb(255,255,255)'background$ dconf write /org/gnome/terminal/legacy/profiles:/<profile id>/background-color 'rgb(0,0,0)'ExampleGet my profile ID$ dconf list /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/Use the profile ID to get a list of settings$ dconf list /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/background-colordefault-size-columnsuse-theme-colorsuse-custom-default-sizeforeground-coloruse-system-fontfontChange your background blue$ dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/background-color 'rgb(0,0,255)'              A Note on colorsYou can use either the notation rgb(R,G,B) when specifying your colors or the hash notation #RRGGBB. In the both notations the arguments are red, green, and blue. The values in the first notation are integers ranging from 0-255 for R, G, or B. In the second notation the values are in hexidecimal ranging from 00 to FF for RR, GG, or BB.When providing either of these to dconf you need to wrap it properly in double quotes with single quotes nested inside. Otherwise dconf will complain.'rgb(0,0,0)''#FFFFFF'etc.Method #2 - Using gconftool-2On my Ubuntu 12.04 system I was able to change the colors via the command line as follows.NOTE: The options are ultimately stored in this file, $HOME/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml.General approachFirst you'll need to get the tree for gnome-terminal's profile.$ gconftool-2 --get /apps/gnome-terminal/global/profile_list[Default]Using the resulting tree we can find out what attributes are configurable.$ gconftool-2 -a /apps/gnome-terminal/profiles/Default | grep color bold_color_same_as_fg = true bold_color = #000000000000 background_color = #FFFFFFFFFFFF foreground_color = #000000000000 use_theme_colors = falseGet/Set the background_color & foreground_color attributes$ gconftool-2 --get /apps/gnome-terminal/profiles/Default/foreground_color#000000000000$ gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string #000000FFFFFF    Confirm$ gconftool-2 -R /apps/gnome-terminal/profiles/Default | grep color bold_color_same_as_fg = true bold_color = #000000000000 background_color = #000000FFFFFF foreground_color = #000000000000 use_theme_colors = trueReferencesCHANGING TERMINAL PREFERENCES IN GNOME 3base16-gnome-terminal / base16-tomorrow.light.shIs there a way to temporarily change the terminal colour?