5

I'm trying to export the color scheme from my Ubuntu 16.04 terminal to use on another system.

I found some posts that suggest:

gconftool-2 --dump '/apps/gnome-terminal' > gnome-terminal-conf.xml

... but that no longer works. I also found someone suggesting using terminal.sexy, but I'm looking for a way to do this through Ubuntu terminal or some other tool I can use locally.

4

Im assuming you mean the profile of Gnome terminal, i.e., the color and size of the fonts in the terminal, background color etc, and not the styling of the GTK window and widgets of the terminal itself.
In Ubuntu 16.04 the GTK version has switched to 3, so gconftool-2 won't work any more, you need to use gsettings.
heres the bash script I use to recreate my gnome-terminal profile on Ubuntu 16.04:

user=YOUR_USERNAME_GOES_HERE

sudo -u $user bash << EOF || exit 1
    # working with gsettings
    #--------------------------
    # 
    # Getting a dump of the new settings
    # 
    # get a list of schemas - so that the schema can be fed into gsettings list-keys
    #
    #     gsettings list-relocatable-schemas | grep -i terminal
    #
    # produces
    # org.gnome.Terminal.SettingsList
    # org.gnome.Terminal.Legacy.Profile
    # org.gnome.Terminal.Legacy.Keybindings
    # 
    # taking "schema" org.gnome.Terminal.Legacy.Profile, produce a list of keys
    #     gsettings list-keys org.gnome.Terminal.Legacy.Profile
    # 
    # get UUID of default profile
    # there is some info on this here:
    # https://wiki.gnome.org/Apps/Terminal/FAQ#How_can_I_change_a_profile_setting_from_the_command_line.3F
    profile=$(gsettings get org.gnome.Terminal.ProfilesList default)
    profile=${profile:1:-1} # remove leading and trailing single quotes

    # getting/dumping values
    #-----------
    # gsettings get \
    #   org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
    #   background-transparency-percent


    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        use-theme-colors false

    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        background-color "#393939"

    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        scrollback-unlimited true

    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        foreground-color "#eee"

    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        use-transparent-background true

    gsettings set \
        org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${profile}/ \
        background-transparency-percent "10"
EOF

These are my preferences, I would recommend installing dconf-editor to locate the appropriate keys that need to be modified to get your own preferences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.