I am using Ubuntu 14.04 and I want to set the background color of my gnome-terminal using the command line.
From what I can tell gconftool-2
is the way to do this but I cant work out what the command is to do this.
my ~/.gconf/apps
directory looks like:
├── %gconf.xml
├── gnome-terminal
│ ├── %gconf.xml
│ └── profiles
│ ├── Default
│ │ └── %gconf.xml
│ └── %gconf.xml
└── nm-applet
└── %gconf.xml
If I run
gconftool-2 -a /apps/gnome-terminal/profiles/Default
I get a long list of key value pairs, e.g. pairs like this
scroll_on_output = false
cursor_blink_mode = system
background_color = #28F528F528F5
which I believe belong to the "default" gnome-terminal profile, but how do I then set these values using gconftool-2
?
Ive worked out I can "get" values with
gconftool-2 --get /apps/gnome-terminal/profiles/Default/background_color
but not sure how to assign a new variable, in this case I would guess its a string, e.g. I would expect it to be something like
gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type=string: #ababab
or something like that?
Best Answer
Apparently gconftool-2 does not work anymore, however dconf did work for me. Close gnome-terminal and run this in xterm or another terminal emulator, or even tty.
Step 1: find the id of your desired profile
My output:
So my Default profile has id
:98707df3-b227-4a01-ae76-310f8270b9bd
Step 2: allow for using custom colors instead of system colors
sudo dconf write /org/gnome/terminal/legacy/profiles:/:98707df3-b227-4a01-ae76-310f8270b9bd/use-theme-colors "false"
Step 3: set your desired background color
sudo dconf write /org/gnome/terminal/legacy/profiles:/:98707df3-b227-4a01-ae76-310f8270b9bd/background-color "'#ABAB9B9B6060'"
Step 4: (re)start gnome-terminal.