Ubuntu: How to configure Gnome 3 through a configuration file?


Before, one could configure certain options in Gnome 2.x through the ~/.gtkrc-2.0 file. With Gnome 3, one would assume that ~/.gtkrc-3.0 works but it doesn't.


gtk 3.0 / Gnome 3 settings can be overwritten using ~/.config/gtk-3.0/, with files gtk.css and settings.ini. They do not exist initially so you have to create the directory and files manually. If you create settings.ini add at least a line containing [Settings] in it, otherwise apps will complain about it missing.

See /usr/share/theme/[theme_name]/gtk-3.0/*.css files for hints of what you can change.

Most likely you will want to use gtk.css to override visual settings from the desktop theme with your own preferences. I usually don't edit gtk.css itself but rather append a line saying @import url("gtk-mine.css"); and put my stuff in gtk-mine.css. This way, in case someone ever overwrites that file, I only lose the @import line, not all my personal rules.

Here's a short example of how to override some scrollbar attributes:


@import url("gtk-mine.css");  


* {    -GtkRange-slider-width: 18;    -GtkScrollbar-has-forward-stepper: 0;    -GtkScrollbar-has-backward-stepper: 0;    -GtkScrollbar-has-secondary-forward-stepper: 0;    -GtkScrollbar-has-secondary-backward-stepper: 0;    -GtkScrollbar-min-slider-length: 30;  }  .scrollbar.slider.vertical,  .scrollbar.button.vertical {    border-radius: 4;  }  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »