Ubuntu – Can ‘~/.local/share/gnome-shell/theme/ubuntu.css’ have priority over ‘/usr/share/gnome-shell/theme/ubuntu.css’


The ubuntu.css file is found in /usr/share/gnome-shell/theme/ubuntu.css. I would like to customise this file. Thereafter, should I replace the original with this customised file (I see this practise on-line) or should I store the customised file to ~/.local/share/gnome-shell/theme/ubuntu.css. I am thinking that it should take priority over /usr/share/gnome-shell/theme/ubuntu.css. Also, I can avoid interfering with sudo permission level files. Is this thought process correct?

Best Answer

  • The standard local directories are ~/.themes or ~/.local/share/themes. You can copy your theme folder to one of these directories and modify the files. But it won't override the default GNOME Shell theme, you need to use the 'User Themes' GNOME shell extension. Then you would be able to activate your modified theme using GNOME Tweaks for example.

    Note that the correct location for the .css file is as follows:
    ~/.themes/<ThemeName>/gnome-shell/gnome-shell.css or

    So copy the ubuntu.css file to, for example, ~/.themes/MyCustomTheme/gnome-shell/ and rename it as gnome-shell.css (you may also have to copy some or all other files in /usr/share/gnome-shell/theme/ to ~/.themes/MyCustomTheme/gnome-shell/ too in this case).

    You should be able to activate "MyCustomTheme" as the GNOME Shell theme after activating the User Themes extension.

  • Related Question