r/gnome • GNOMie • Aug 02 '22

Extensions Material You Theme extension that updates your libadwaita apps based on wallpaper

272 Upvotes

41 comments sorted by

33

u/aviroblox GNOMie Aug 02 '22

I saw a suggestion to make an extension with the script I had in my previous post, so I got it working as a theme extension available here: https://extensions.gnome.org/extension/5236/material-you-color-theming/

Additionally, the Github repo for the code is available here: https://github.com/avanishsubbiah/material-you-theme

14

u/PsyAlyen GNOMie Aug 02 '22

I installed it. Enabled it. Even refreshed the theme using the icon but its not applying. im also using default theme. Any tips?

10

u/aviroblox GNOMie Aug 02 '22

By default the configuration is only read by native libadwaita applications. See the GitHub readme for instructions on how to make native Gtk3 and Flatpak libadwaita and Gtk3 apps work with the extension.

5

u/PsyAlyen GNOMie Aug 02 '22

I enabled the extension and applications like calculator and nautilus show no change.

9

u/aviroblox GNOMie Aug 02 '22

Nautilus is in native GTK4 without libadwaita it seems. The development version of Nautilus written in libadwaita works for me. Also the calculator (if it is the libadwaita version) should work.

Have you installed Flatseal and updated the application permissions as shown in the readme? It may be that your calculator application is installed as a flatpak which doesn't have file permissions to read the config by default.

5

u/PsyAlyen GNOMie Aug 02 '22

You are right. Nautilus was the one throwing me off but now everything works.
Thank you. Its an awesome extension

1

u/giannidunk GNOMie Aug 04 '22

Nautilus will be adwaita in Gnome 43 FYI

1

u/Super_Papaya Aug 02 '22

kill nautilus with nautilus -q

1

u/Utsuri Aug 02 '22

me too, i can't get it to work with gtk4 and gtk3

1

u/[deleted] Aug 06 '22

download adw-gtk theme and enable it in tweaks

5

u/TheEpicZay GNOMie Aug 02 '22

Would be cool if this was fully compatable with Night Theme Switcher

4

u/aviroblox GNOMie Aug 02 '22

Yeah I was looking into that. Not sure exactly how to set the config so that the dark theme switch built in to Gnome recognizes it.

3

u/TheEpicZay GNOMie Aug 02 '22

Night Theme Switcher" Extention. It basically sets light/dark mode automatically depending on the time of the day.

1

u/TheEpicZay GNOMie Aug 02 '22

I swear I wrote something here in the beginning and Reddit just straight up deleted it

4

u/evoeden Aug 02 '22

Really cute, but sad it's not dynamic when you change wallpaper.

6

u/aviroblox GNOMie Aug 02 '22

I don't want to have a background polling function to check the wallpaper, but I don't know of any way to put a hook on gsetting changes so for now I'm sticking to a manual refresh

9

u/rmnvgr Extension Developer Aug 02 '22
const settings = new Gio.Settings({ schema: 'org.gnome.desktop.background' });
settings.connect('changed::picture-uri', () => { log('Default background changed!'); });
settings.connect('changed::picture-uri-dark', () => { log('Dark background changed!'); });

If you have questions about extension development, you can join the extensions:gnome.org Matrix channel.

6

u/aviroblox GNOMie Aug 03 '22

Added those changes to the repo. The newer version of the extension removes the indicator and works completely in the background by auto changing the theme when the wallpaper or system color preference changes

3

u/Otherwise_Direction7 GNOMie Aug 02 '22

Does this extension can auto update the theme upon the wallpaper change?

4

u/aviroblox GNOMie Aug 02 '22

No there's a refresh button you can click to regenerate the theme after you change your wallpaper

1

u/Otherwise_Direction7 GNOMie Aug 03 '22

Um, hey... so I have installed the extension and it worked quite well, except for a one thing

It doesn't change the color of adw-gtk3 theme (that have been applied to the native and Flatpak apps)

I have tried the latest version and the native package version of the theme plus have followed the theming instructions on your GitHub page but it still doesn't change it

Any fixes or workaround for this?

(I'm in Fedora 36, btw)

2

u/creackoff GNOMie Aug 02 '22 edited Aug 02 '22

wow, this is wonderful. By the way is it theoretically possible to apply dynamically on opened apps after I click "refresh theme" like in the way native light/dark theme is switched. Right now I have to reopen an app to see the changes.

2

u/aviroblox GNOMie Aug 02 '22

I would like to add that improvement. I'm looking at Night Theme switcher to see how they did their dynamic, animated switch

1

u/xaedoplay GNOMie Aug 03 '22

is it theoretically possible to apply dynamically on opened apps after I click "refresh theme" like in the way native light/dark theme is switched

Unfortunately due to the way the recoloring is implemented it is impossible to do so.

2

u/[deleted] Aug 02 '22 edited Aug 02 '22

Refresh Material Theme is not working for some wallpapers, color accent for switches & text highlight is too light (either when you select some text or when you go in about section of some app with name credits in hyperlink) & background color accent for windows are also still not applied (they are in white). Also, mostly it chooses bogus color accent for wallpapers (light blue for grass instead of light green, light purple instead of strong blue for city landscape in night) etc. Only wallpaper which worked well and which also got applied window background color to darker shade of yellow is wallpaper completely covered with yellow leaves.

I understand that some of those things are not your fault, that wallpaper color detection algorithm is up to Google, not up to you.

So to that regard, thanks for making this extension.

2

u/aviroblox GNOMie Aug 02 '22 edited Aug 02 '22

For performance reasons the wallpapers are scaled down to 64x64 pixels. From my testing it doesn't really change the color theme generated that much to scale it higher, but I plan on adding a settings section where that will be customizable for accuracy.

However, something to note is that the material-color-utilities algorithm pics one single color it ranks as the "best" from a wallpaper (not necessarily the most common color but the "best" using a scoring function in score.js) and generates an entire theme based on that single color.

1

u/[deleted] Aug 04 '22 edited Aug 04 '22

New extension update is really dope! Automatic Material You applying on wallpaper and theme works well & accent colors are now darker as I like! I use light theme. Thank you very much!

I have a bug to report: Material you gets applied every time I go to lock screen (Super + L keyboard key). Also when you log in & start your PC.

2

u/aviroblox GNOMie Aug 04 '22

Yeah so I'm not sure what to do about that. I have to remove the theme when the extension is disabled, but the extension is technically disabled and re-enabled on log-out/log-in. So I have the extension just regenerate the theme when the extension is enabled which happens on login

1

u/[deleted] Aug 04 '22

Maybe you can just hide notification in those cases if possible?

2

u/aviroblox GNOMie Aug 04 '22

Yeah, I did that at first but there was confusion on whether the extension was working so I plan on adding a option to disable the notifications that are enabled by default

7

u/xaedoplay GNOMie Aug 02 '22

This extension caught my attention earlier today when I wanted to check out "Material Shell". Great job.

6

u/PKRN__ Aug 02 '22

Wow, this looks so cool!

Few days ago I saw a script that makes a color theme preset for adwcustomizer with Material You and I though it would be awesome if someone combine it into an extension. And here it is! so cool

4

u/[deleted] Aug 02 '22

YES! Now just be native!

4

u/HoodieWolfine GNOMie Aug 02 '22

Nice, can't wait to see it become an official feature~!

1

u/dibyansh2325 GNOMie Aug 04 '22

Is there any way to change the Shell theme as well ? cuz after installing adw-gtk3 everything looks coherent except the Shell.

1

u/aviroblox GNOMie Aug 04 '22

Yeah it's not too hard to manually edit the scss and recompile a new gnome-shell, but it seems that to add that to the extension I've gotta convert the dart sass project to gjs so it might take a while to do that.

1

u/[deleted] Aug 02 '22

RemindMe! 2 days

1

u/RemindMeBot Aug 02 '22

I will be messaging you in 2 days on 2022-08-04 20:04:45 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

1

u/HermanGrove Aug 02 '22

I love it but the lines and the shadows look kinda ugly. Maybe they should be slightly colored too?

1

u/PulangOkra Aug 11 '22 edited Aug 12 '22

Neat extension. Would you mind sharing that wallpaper as well, please? It looks nice.