GNOME Bugzilla – Bug 644271
[PATCH] Add extension that prefers local theme to system theme
Last modified: 2011-08-03 07:08:44 UTC
Created attachment 182915 [details] extension We are starting to see themes for gnome-shell. http://half-left.deviantart.com/art/GNOME-Shell-Smooth-Inset-200111295 It might be safer to let people do this per-user instead of editing the system wide theme. The attached extension loads the shell theme from ~/.local/share/gnome-shell/theme/ if present.
Created attachment 182916 [details] extension metadata note: the shell version might need to be changed to match your shell version
What about loading it from .themes/<Name>/gnome-shell and having a GSettings key with the theme name? It would allow to install more than one theme, and change it without even restarting the shell.
(In reply to comment #2) > What about loading it from .themes/<Name>/gnome-shell and having a GSettings > key with the theme name? > It would allow to install more than one theme, and change it without even > restarting the shell. Would you take a patch for that against gnome-shell, or would you prefer it as an extension?
It is unlikely that it would be accepted inside gnome-shell for this release, so an extension is preferred. We can merge it back in 3.2 if wanted.
OK. What is the default theme name BTW?
I don't know, I suppose Adwaita, like the rest of GNOME 3.
Created attachment 183036 [details] [review] Add user-theme extension
Created attachment 183037 [details] [review] Add user-theme extension
Review of attachment 183037 [details] [review]: You should watch for changes to the settings, and reload the theme appropriately. Otherwise, it is good to commit.
Created attachment 183106 [details] [review] Add user-theme extension v2: monitor gsettings key and reload theme when it changes
Attachment 183106 [details] pushed as 27a1714 - Add user-theme extension
I have a little extension that does quite the same work, but with system-wide themes support. It also has a selector (looks like a test for now). I use ~/.local/share/themes as it seems more XDG compliant but obviously it's simple to change (or add) it. https://github.com/sardemff7/GS-Theme-Selector If my extension is useful (and/or better) I'll provide the corresponding format-patch.
Awesome! I wish you had mentioned this on the g-s mailing list when I posted my patch. Never mind... I initially had the themes in the XDG dir, but changed it to match the unusual historical fact that themes live in ~/.themes/theme-name/thing-they-are-theming Anyway, your patch is much more comprehensive, so I suggest you can re-open this bug and attach it here for discussion. It should probably replace mine I use https://github.com/nzjrs/gnome-tweak-tool for changing themes at the moment Giovanni, what do you think?
1) Ideally, we should use whatever directory metathemes are installed in. Currently, this is ~/themes/ThemeName (and $XDG_DATA_DIRS/themes/ThemeName). Also, it would be nice if metathemes had a ShellTheme key, indicating gnome-shell support, but this is not required now. (The idea is to pick "Adwaita" or "Elementary" or "Clearlooks" and get all the system changed immediately). If, and when, .themes is moved to ~/.local/share, it will be easy to adapt (requires changing gtk, metacity, mutter). 2) I strongly oppose the "Switch theme" overview page. This should either be a Looking Glass pane, or an external tool. 3) The extension is now upstream. Attach a patch if you plan to add functionality.
This is handled by user-theme extension now