How to Export and Import Gnome Terminal Profile in Ubuntu

Gnome Terminal is customizable, due to this some prefer to use default settings and some prefer to customize their terminal. I always have different profiles created with different color schemes and switch between them.

[ You might also like: How to Clean Your Ubuntu System Using Bleachbit Tool ]

These profiles need to be exported so they can be imported and used in other machines. There is no export option available in the terminal by default so you have to use an alternate option to export the profiles. This is where dconf comes into play. The dconf helps you modify and maintain low-level system configuration settings.

How to Install dconf-editor in Ubuntu

You can export, load, or reset your settings using the dconf command-line tool which is also has a GUI editor which can be used to manipulate your settings too.

To install dconf-editor, open your terminal and type the following command to install and launch dconf-editor.

$ sudo apt update
$ sudo apt install dconf-editor
$ dconf-editor & 
Dconf Editor
Dconf Editor

How to Export Gnome Terminal Keybindings

Gnome terminal has predefined keybindings, which can be customized. I modified <New Tab> keybinding to <CTRL+T>.

Custom Key Bindings
Custom Key Bindings

Open dconf editor and go to the path “/org/gnome/terminal/legacy/keybindings/”. Here you can find the list of keybindings and the modified one too.

Dconf Editor Keybinding
Dconf Editor Keybinding

You can export the list of keybindings and import them whenever needed.

$ dconf list /org/gnome/terminal/legacy/keybindings/
$ dconf read /org/gnome/terminal/legacy/keybindings/new-tab
Read a Key Value
Read a Key-Value

Take a look at the above image, using the “dconf list <path>” command you can get the changes made to the keybindings. Using the read command you can get the modified keybinding value.

When you try to export the keybindings only the modified keybindings will be exported. Run the following command to export.

$ dconf dump /org/gnome/terminal/legacy/keybindings/ > ~/keys.dconf
$ cat ~/keys.dconf
Export Keybindings
Export Keybindings

Now I am resetting the keybindings to default so I can use the exported keybindings to retain my custom keybindings.

$ dconf reset -f /org/gnome/terminal/legacy/keybindings/

To import the custom keybinding run the following load command.

$ dconf load /org/gnome/terminal/legacy/keybindings/ < ~/keys.dconf

Go and check your terminal shortcuts, your custom keybinding is retained.

How to Export and Import Gnome Terminal Profile

When you customize your terminal settings you will name them or be it a default profile. I have a profile created named “Ubuntu1”. Each profile will have a UID associated with it. Run the following command to get the list of profiles.

$ dconf list /org/gnome/terminal/legacy/profiles:/
List Terminal Profiles
List Terminal Profiles

You can see from the above image there are UID that are part of the profiles I created. You can cross-verify it from your terminal profile. Exporting the profile is the same as what we did for keybindings.

We are going to use the dump command to export the changes and the load command to import the profile. Run the following command to export the profile. Replace UID with your profile UID.

$ dconf dump /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ > ~/ubuntu1.dconf
Export Gnome Terminal Profile
Export Gnome Terminal Profile

Now reset your terminal settings and import the profile to see if everything works fine.

$ dconf reset -f /org/gnome/terminal/legacy/profiles:/
$ dconf load /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ < ~/ubuntu1.dconf 

You will see your terminal is changed immediately once you execute the load command.

That’s it for this article. When using dconf handle with care as it will break the system if you do something wrong.

Got something to say? Join the discussion.