nana-4 / materia-theme

A Material Design theme for GNOME/GTK based desktop environments
GNU General Public License v2.0
3.42k stars 254 forks source link

[help] custom theme / hacking.md #203

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello :)

I'm trying to make a custom theme but I'm quite lost. I managed to make changes and it seems that the generated theme has the correct assets and files, but when I enable it then it uses Materia' defaults.

Is the HACKING.md file up-to-date?

Would it be possible to improve it by detailing every step?

I tried to create a script but it was based on release 20180110 so it doesn't work yet with master which got new hierarchy. By the way this script is WIP, custom _colors.scss files aren't finished yet and contain mistakes.

Thank you!

nana-4 commented 6 years ago

Hi,

I tried to run ./materia-opensuse.sh in v20180110 then I got these error logs:

$ ./materia-opensuse.sh
== Generating the CSS...
Error: Undefined variable: "$gdm-bg-color".
        on line 2124 of src/gnome-shell/3.18/sass/_common.scss
>>   background: $gdm_bg_color;
   --------------^
$ ./materia-opensuse.sh
== Generating the CSS...
Error: Undefined variable: "$grey-900".
        on line 1515 of src/gnome-shell/3.26/sass/_common.scss
>>     background-color: $grey_900;
   ----------------------^

Seems your script doesn't define $gdm_bg_color and $grey_900, so ./parse-sass.sh stopped and didn't change the CSS files properly.

Adding these color variables to the SCSS files with your script should solve this issue:

p.s. Your script looks very fine though, but I will update HACKING.md and describe how to change all the color schemes manually. :)

ghost commented 6 years ago

Thank you, yeah I'll define missing colors, and try again (in v20180110). If it works I'll try to convert my script for new current structure.

Working at night 6/7 + being very ill since three days = heavy brainfarts 😆

I'll look at your HACKING.md update when it's online.

Thank you, it's nice to help people tweaking your theme.

actionless commented 6 years ago

have you tried using ./change-color.sh script from the root of materia repo to achieve the same result?

ghost commented 6 years ago

Yeah but it doesn't work as intended, some colors are not in right place and it's not flexible enough. Tried Oomox too ;) I need more control on changes that are made, it's why I'm tweaking manually.

But Oomox is a great piece of software and a wonderful tool for people wanting to make some custom stuff. You did great with this and I can't wait to see future improvements/possibilities on it.

actionless commented 6 years ago

what exactly is not good? mb you can improve it in change-color.sh script instead of creating a new one?

also in the near future instead of sed-ing _colors.css i am planning to include _colors.css.template which should be more robust approach. if you're thinking of somehting similar together we can achieve faster and better result

ghost commented 6 years ago

The problem that I met with current change-color.sh is that it tries to parse only a few colors within the same template on all the files. Depending of colors selected by the user, it can make a light panel with white fonts and a dark menu with black fonts and some other issues. And GTK2 is totally messed up the same way. For example when I tried to use my openSUSE scheme with Oomox, I had wrong colors on GNOME panel, and GTK2 was totally different.

However don't think that I'm making a script because I want to reinvent the wheel, it's just a tool for me to build my custom theme in one click while being sure that all the changes that I need are made.

I'b be glad to help but I'm not a bash expert, not a theming expert either, I made my own distro years ago but I almost forgot everything and a lot of stuff changed :p but when I have a 100% working script feel free to adapt it for Oomox, as I'll release it with my theme once it's done.

By the way it would be great to know how exactly @nana-4 built his "material-ubuntu" variant, maybe it could give us more ideas.

ghost commented 6 years ago

Ok I modified my script and now it works flawlessly with master version. Still, my custom theme is far from being ready because GTK3 styling is new for me so my variant is a bit broken for the moment lol.

ghost commented 6 years ago

I close this issue as I'm done with my theme and don't want to pollute your issues page. Thank you again for your help and feel free to take a look at my script (in source folder), but it's very basic (maybe too basic lol, but it works).

actionless commented 6 years ago

that's to leave some space for future speed-improvements? :-)

https://github.com/DarthWound/erdlowe-theme/blob/cdc5577e3b5c15ce8de1a88c33bc2a4f18e23d85/source/materia-to-erdlowe.sh#L16-L25

ghost commented 6 years ago

The sleep 3s thing? I know it's a bit slow maybe I'll change it later, but I prefer to be sure that changes are correctly made, sometimes when I sed or cat something and do another command just after that then it doesn't take changes in account. But you're right it may be annoying.

actionless commented 6 years ago

you can try sync mb instead of sleep

ghost commented 6 years ago

Thank you for the tip :)

ghost commented 6 years ago

@nana-4 I've a weird graphical issue on "list buttons" (don't know their name) in GTK2 with my custom theme but not with Materia, any clue on that? Thanks :-)

capture d ecran de 2018-02-07 08-48-50

nana-4 commented 6 years ago

@DarthWound So sorry for the late reply... I was busy and didn't have much time. :(

I could reproduce the strange issue in your GTK2 theme, and it seems to happen with all the buttons.

image

I don't know the exact cause, but I guess it's probably a rendering bug of the "pixmap engine" or GTK2 itself.

But I found a workaround to render them properly by using #FEFEFE instead of #FFFFFF for the button background color. It should work, I guess. :)

- sed -i 's/#FAFAFA/#FFFFFF/g' src/gtk-2.0/assets.svg
+ sed -i 's/#FAFAFA/#FEFEFE/g' src/gtk-2.0/assets.svg
ghost commented 6 years ago

Don't be sorry, as I said it's already very nice to help me :) I'm very busy too so I understand.

Thank your for the tip, I'll build a new version with #FEFEFE when I've got some spare time.

ghost commented 6 years ago

Just to say thank you again, it worked well and I built a new version of my theme with this fix.

nana-4 commented 6 years ago

@DarthWound Great. You’re welcome!