LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bodhi (https://www.linuxquestions.org/questions/bodhi-92/)
-   -   Bodhi Themes - the scale of the problem (https://www.linuxquestions.org/questions/bodhi-92/bodhi-themes-the-scale-of-the-problem-4175643987/)

bobl01 12-10-2018 04:42 AM

Bodhi Themes - the scale of the problem
 
This isn't a question as such. It's more of an explanation of the issues surrounding desktop and application themes.

A few weeks back, I rendered some very minor assistance to Stefan who was working on the Moksha Seven theme. Stefan went on to rework the Vista GTK theme, and then the Bodhi Forum theme. Stefan recently asked me to investigate whether it might be possible to automate (or at least reduce the amount of work) required to rework a theme. My investigations are still on-going. However, here is just a small part what I've found so far which I hope you might find interesting (and possibly mind-blowing).

Since GTK 3, application themes are stored as a sequence of rules in a language which is very similar to CSS. Well, I think we're all probably familiar with CSS, so no problem, right? Well, looking at the Windows Vista GTK theme, there are some 4500 lines of CSS source code, defining over 2000 CSS selector rules, and over 750 definition blocks! Taking just a few CSS tokens at random, the word ".button" appears in over 300 rules, ":hover" in over 150 rules, and "color:" in about 200 definition blocks. (That's just "color:", there's also "background-color:" which appears in about 300 definition blocks!

Unfortunately, since GTK 3.20, the way the rules are defined has changed, so it's now necessary to recast the 3.0 rules into a completely new set of 3.20 rules following new conventions, and it's not at all clear that there's a 1:1 correspondence between old and new. Currently, there are 3000 lines of CSS code in the 3.20 version of the Windows Vista GTK theme. And the rules can be changed for specific apps!

In addition to this complexity, the older GTK 2.0 application themes work in an entirely different way, and the actual desktop theme (as opposed to the GTK app themes) works to yet another different and highly complex standard.

There is a lack of high quality documentation and modern tools, and although there are any number of "how to make your own theme" web tutorials, most of them boil down to grabbing another theme and playing with the colour definitions until you get something you like. Not exactly a reliable way to create a concise set of rules.

I take my hat off to Stefan who is able to cope with this level of complexity. I am over-awed by it, and my inner critic is yelling in my ear that there must be an easier way! Just be aware that each time you run a GTK application, one of its very first jobs is to read 3000+ lines of text simply to decide which background colour it should use for its windows!

My investigations continue; however, there is a serious possibility of my brain melting before I'm able to finish.

ondoho 12-11-2018 01:54 AM

tl;dr:
GTK3 theme creation is a major pita, and adding injury to insult, GTK3 developers like to break their own rules every few releases or so (making themes incompatible with different versions of gtk3, without graceful degredation).

yes, hats off to anyone who even attempts to make a gtk3 theme from scratch.

for the lesser among us, projects like oomox have proven very helpful.

the_waiter 12-11-2018 02:48 AM

Yes, exactly oomox is my next step I will take. I used it for dark-green theme and worked fine. The mokshaforum GTK 3.20 is slmost ready but I have found other maybe 5 maintained themes without GTK 3.20 and it is necessary to be done. I will create the main theme skeleton with oomox and then doing all that hard and laborous decoration work. I will inform you how it goes.

Stefan

the_waiter 12-13-2018 06:35 AM

Today I have some hours free for Bodhi work. I installed the newest oomox and I have to say it helps me a lot. Within some minutes I can provide all GTK, Metacity, openbox themes. Fantastic. My 10 min work to match MokshaSunshine theme:

https://i.imgur.com/fLhVhk3.jpg

I think this way could be fine for maintaining our themes. Let me have some more time for fixing all themes and uploading it to the repo.

Stefan

ondoho 12-14-2018 12:56 AM

I would love to convert some of my oldest GTK2 themes (i once found a box of them in some www attic) with oomox. 15 years ago, ui designers were much better with colors (probably because there wasn't much else to work with).

JollyRoger1939 12-14-2018 03:43 AM

I still have the old A-crema theme on my computer, and use the (analog) clock from that theme on my MokshaForum desktop. It was a great theme.

the_waiter 12-14-2018 06:24 AM

Jolly: do you mean that coffee theme? If yes, I like it too.

JollyRoger1939 12-14-2018 11:40 AM

Yes, Stefan, I do mean that theme. The last time I used it (with Bodhi 3 I think) I had to use the widgets from another theme to make everything work.

the_waiter 12-15-2018 01:51 PM

That coffee theme is nice although the elm theme is missing. Maybe one day I will fix this theme...

JollyRoger1939 12-16-2018 01:47 PM

I was prompted by the above posts to use the A-crema (coffee) theme on one of my computers (running Bodhi 4). I had to assign the widgets from another theme (I chose the Sunshine theme) to make it work properly, and I also assigned the Sunshine GTK (Application) theme to make the appearance of apps match it reasonably well. The result is pretty good, though it needs some of Stefan's clever tweaks to make it perfect.

I didn't repeat this experiment on my Bodhi 5 machine, as that computer is essential to the things I do, and I didn't want to risk messing it up.

the_waiter 12-16-2018 02:00 PM

Let me finish all the GTK themes for the main themes we have in repository. Today I made 5 of them. Just asked Ylee to have a look and make debs for repository. If tests pass I can look at this A-crema theme and fix all issues I will see. Now I am also able to create GTK themes for A-crema within several minutes with oomox tool.

https://github.com/thewaiter?tab=repositories

Themes with GTK 3.20 support so far:
- Arc
- Blingbling screenshot example: https://i.imgur.com/ROgTrhV.jpg
- Sunshine screenshot example: https://i.imgur.com/qk8JyrR.jpg
- Moonlight screenshot example: https://i.imgur.com/QZhM3FC.jpg
- Forum screenshot example: https://i.imgur.com/MyUOBie.jpg
- Detour
- Radiance

BTW: as far as GTK themes are concerned, please don't expect such an art work as with BodhiForum. I really don't want spend years with theming. Just need to fill theme gaps which are not covered. That's why I use the oomox generator.

Stefan

JollyRoger1939 12-16-2018 02:15 PM

You're brilliant, Stefan. Many thanks.


All times are GMT -5. The time now is 10:37 PM.