After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644271 - [PATCH] Add extension that prefers local theme to system theme
[PATCH] Add extension that prefers local theme to system theme
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: extensions
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-09 02:11 UTC by John Stowers
Modified: 2011-08-03 07:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
extension (441 bytes, application/javascript)
2011-03-09 02:11 UTC, John Stowers
  Details
extension metadata (187 bytes, application/octet-stream)
2011-03-09 02:12 UTC, John Stowers
  Details
Add user-theme extension (5.92 KB, patch)
2011-03-10 00:53 UTC, John Stowers
none Details | Review
Add user-theme extension (5.92 KB, patch)
2011-03-10 00:55 UTC, John Stowers
reviewed Details | Review
Add user-theme extension (6.32 KB, patch)
2011-03-11 00:39 UTC, John Stowers
committed Details | Review

Description John Stowers 2011-03-09 02:11:56 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.
Comment 1 John Stowers 2011-03-09 02:12:50 UTC
Created attachment 182916 [details]
extension metadata

note: the shell version might need to be changed to match your shell version
Comment 2 Giovanni Campagna 2011-03-09 14:07:39 UTC
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.
Comment 3 John Stowers 2011-03-09 19:41:40 UTC
(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?
Comment 4 Giovanni Campagna 2011-03-09 20:01:38 UTC
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.
Comment 5 John Stowers 2011-03-09 20:15:32 UTC
OK.

What is the default theme name BTW?
Comment 6 Giovanni Campagna 2011-03-09 21:38:17 UTC
I don't know, I suppose Adwaita, like the rest of GNOME 3.
Comment 7 John Stowers 2011-03-10 00:53:45 UTC
Created attachment 183036 [details] [review]
Add user-theme extension
Comment 8 John Stowers 2011-03-10 00:55:14 UTC
Created attachment 183037 [details] [review]
Add user-theme extension
Comment 9 Giovanni Campagna 2011-03-10 14:25:12 UTC
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.
Comment 10 John Stowers 2011-03-11 00:39:40 UTC
Created attachment 183106 [details] [review]
Add user-theme extension

v2: monitor gsettings key and reload theme when it changes
Comment 11 John Stowers 2011-03-11 00:44:47 UTC
Attachment 183106 [details] pushed as 27a1714 - Add user-theme extension
Comment 12 Quentin "Sardem FF7" Glidic 2011-03-11 18:07:59 UTC
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.
Comment 13 John Stowers 2011-03-12 00:30:27 UTC
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?
Comment 14 Giovanni Campagna 2011-03-12 14:20:20 UTC
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.
Comment 15 John Stowers 2011-08-03 07:08:44 UTC
This is handled by user-theme extension now