How to set built-in color scheme for gnome-terminal via CLI in Ubuntu 16?
As egmont mentioned in a comment,
the color "scheme" (e.g. "rxvt") is not stored in the settings, it's the 16 individual colors that are stored. The color "scheme" is only a concept of the graphical profile editor.
16.04
In the below commands, replace $profile
with your profile ID, which you can get from
dconf list /org/gnome/terminal/legacy/profiles:/
If you have only one profile, you can create the variable:
profile="$(dconf list /org/gnome/terminal/legacy/profiles:/ | sed 's./..')"
-
Tango
dconf write /org/gnome/terminal/legacy/profiles:/$profile/palette "['rgb(0,0,0)', 'rgb(204,0,0)', 'rgb(78,154,6)', 'rgb(196,160,0)', 'rgb(52,101,164)', 'rgb(117,80,123)', 'rgb(6,152,154)', 'rgb(211,215,207)', 'rgb(85,87,83)', 'rgb(239,41,41)', 'rgb(138,226,52)', 'rgb(252,233,79)', 'rgb(114,159,207)', 'rgb(173,127,168)', 'rgb(52,226,226)', 'rgb(238,238,236)']"
-
Linux console
dconf write /org/gnome/terminal/legacy/profiles:/$profile/palette "['rgb(0,0,0)', 'rgb(170,0,0)', 'rgb(0,170,0)', 'rgb(170,85,0)', 'rgb(0,0,170)', 'rgb(170,0,170)', 'rgb(0,170,170)', 'rgb(170,170,170)', 'rgb(85,85,85)', 'rgb(255,85,85)', 'rgb(85,255,85)', 'rgb(255,255,85)', 'rgb(85,85,255)', 'rgb(255,85,255)', 'rgb(85,255,255)', 'rgb(255,255,255)']"
-
XTerm
dconf write /org/gnome/terminal/legacy/profiles:/$profile/palette "['rgb(0,0,0)', 'rgb(205,0,0)', 'rgb(0,205,0)', 'rgb(205,205,0)', 'rgb(30,144,255)', 'rgb(205,0,205)', 'rgb(0,205,205)', 'rgb(229,229,229)', 'rgb(76,76,76)', 'rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(255,255,0)', 'rgb(70,130,180)', 'rgb(255,0,255)', 'rgb(0,255,255)', 'rgb(255,255,255)']"
-
Rxvt
dconf write /org/gnome/terminal/legacy/profiles:/$profile/palette "['rgb(0,0,0)', 'rgb(205,0,0)', 'rgb(0,205,0)', 'rgb(205,205,0)', 'rgb(0,0,205)', 'rgb(205,0,205)', 'rgb(0,205,205)', 'rgb(250,235,215)', 'rgb(64,64,64)', 'rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(255,255,0)', 'rgb(0,0,255)', 'rgb(255,0,255)', 'rgb(0,255,255)', 'rgb(255,255,255)']"
-
Default
(same as Tango but with different palette color 1 -- dark grey instead of black)
dconf write /org/gnome/terminal/legacy/profiles:/$profile/palette "['rgb(46,52,54)', 'rgb(204,0,0)', 'rgb(78,154,6)', 'rgb(196,160,0)', 'rgb(52,101,164)', 'rgb(117,80,123)', 'rgb(6,152,154)', 'rgb(211,215,207)', 'rgb(85,87,83)', 'rgb(239,41,41)', 'rgb(138,226,52)', 'rgb(252,233,79)', 'rgb(114,159,207)', 'rgb(173,127,168)', 'rgb(52,226,226)', 'rgb(238,238,236)']"
or
dconf reset /org/gnome/terminal/legacy/profiles:/$profile/palette
With help from this comment
14.04
In the below commands, replace $profile
with your profile name, which you can get from
gconftool-2 --all-dirs /apps/gnome-terminal/profiles
It will usually be Default
.
-
Tango
gconftool-2 --set /apps/gnome-terminal/profiles/$profile/palette --type=string "#000000000000:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC"
-
Linux console
gconftool-2 --set /apps/gnome-terminal/profiles/$profile/palette --type=string "#000000000000:#AAAA00000000:#0000AAAA0000:#AAAA55550000:#00000000AAAA:#AAAA0000AAAA:#0000AAAAAAAA:#AAAAAAAAAAAA:#555555555555:#FFFF55555555:#5555FFFF5555:#FFFFFFFF5555:#55555555FFFF:#FFFF5555FFFF:#5555FFFFFFFF:#FFFFFFFFFFFF"
-
XTerm
gconftool-2 --set /apps/gnome-terminal/profiles/$profile/palette --type=string "#000000000000:#CDCB00000000:#0000CDCB0000:#CDCBCDCB0000:#1E1A908FFFFF:#CDCB0000CDCB:#0000CDCBCDCB:#E5E2E5E2E5E2:#4CCC4CCC4CCC:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#46458281B4AE:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF"
-
Rxvt
gconftool-2 --set /apps/gnome-terminal/profiles/$profile/palette --type=string "#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#00000000CDCD:#CDCD0000CDCD:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF"
-
Default
(same as Tango but with different palette color 1 -- dark grey instead of black)
gconftool-2 --set /apps/gnome-terminal/profiles/$profile/palette --type=string "#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC"
or
gconftool-2 --unset /apps/gnome-terminal/profiles/$profile/palette
With help from this answer
By the way, doing this via GUI is easy:
- Open
gnome-terminal
- Go to Edit → Profile preferences → Colors → Palette
- Change the Built-in scheme
Related videos on Youtube
Comments
-
Lasse Meyer over 1 year
I want to change the color scheme of gnome-terminal to the built-in scheme Rxvt. I know how to set the fore- and background color and 'use-theme-colors', with gsettings, but I just can't find the right key to set the scheme.
-
egmont almost 8 yearsJust to emphasize: the color "scheme" (e.g. "rxvt") is not stored in the settings, it's the 16 individual colors that are stored. The color "scheme" is only a concept of the graphical profile editor.
-
egmont almost 8 years@youtubefreak With 16.04 you'll need
gsettings
ordconf
(with similar but different command line syntax thangconftool-2
). -
Dreamcat4 almost 7 yearsusing
dconf
didn't work for me... butgsettings
did work. This was onGNOME Shell 3.18.5
andGNOME Terminal 3.18.3
. For example:_profile="$(dconf read /org/gnome/terminal/legacy/profiles:/default | tr -d "'")"
, and thengsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${_profile}/ palette "['rgb(0,0,0)', ... etc ... 'rgb(238,238,236)']"