load-gsettings 695 B

123456789101112131415
  1. #!/bin/sh
  2. # usage: import-gsettings
  3. config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
  4. if [ ! -f "$config" ]; then exit 1; fi
  5. gnome_schema="org.gnome.desktop.interface"
  6. gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
  7. icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
  8. cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
  9. font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
  10. gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
  11. gsettings set "$gnome_schema" icon-theme "$icon_theme"
  12. gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
  13. gsettings set "$gnome_schema" font-name "$font_name"