Skip to content

Instantly share code, notes, and snippets.

@andytumelty
Created December 12, 2015 21:43
Show Gist options
  • Save andytumelty/4ac0e672c73789f85ee3 to your computer and use it in GitHub Desktop.
Save andytumelty/4ac0e672c73789f85ee3 to your computer and use it in GitHub Desktop.
gnome-terminal settings sync
#!/bin/sh
# export-settings
# echos all gnome-terminal dconf settings for the first gnome-terminal profile
# the idea is you'll direct the output of this to somewhere to be consumed by
# import-settings
# note: I have no idea what the order of the profiles list is. I only have one
# profile, so don't really care either
profile_id=$(dconf list /org/gnome/terminal/legacy/profiles:/ | head -1)
# currently grabs all settings, suggest moving list of setting to config file
while read setting; do
echo "$setting:$(dconf read /org/gnome/terminal/legacy/profiles:/$profile_id$setting)"
done <<< "$(dconf list /org/gnome/terminal/legacy/profiles:/$profile_id)"
#!/bin/sh
# import-settings $settings-file
# imports saved gnome-terminal settings from the specified file
# settings are dconf settings in the form key:"value" and are imported to the
# first reported terminal profile
profile_id=$(dconf list /org/gnome/terminal/legacy/profiles:/ | head -1)
settings_file=$1
# currently grabs all settings, suggest moving list of setting to config file
while read setting; do
key=${setting%%:*}
value=${setting##*:}
echo "dconf write /org/gnome/terminal/legacy/profiles:/$profile_id$key \"$value\""
dconf write /org/gnome/terminal/legacy/profiles:/$profile_id$key "$value"
done < $settings_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment