I give up: How to change the title bar background color

Forum rules
Before you post please read how to get help
Post Reply
jonr
Level 1
Level 1
Posts: 2
Joined: Tue Jan 16, 2018 9:58 am

I give up: How to change the title bar background color

Post by jonr » Tue Jan 16, 2018 12:50 pm

First time poster, long time lurker here.

I have been trying to make my own theme and i'm going nuts trying to change the color of the title bar window.

I downloaded a theme to play with (Mint-Y-Yltra-Dark, nice theme check it out)

After googling my ass off, and changing things both in /theme/cinnamon/cinnamon.css and /theme/gtk-3.0/gtk.css without any change, I got frustrated, downloaded the theme again, found the color of the title bar (#2f2f2f) and replaced every occurrence of it with red (#ff2f2f) in gtk.css and green (#2fff2f) in cinnamon.css.

And this is the result: Image

I must be missing something super obvious.

Where do cinnamon/gtk theme makers hang out?

J.

Edit: After short break and cursing, I took another look at this. My Linux n00bism was showing. There are 3 layers of GUI config WM/GTK -> Gnome -> Cinnamon. GTK has it's own config files named metacity-something (wat?). Now I can update them hack them and then force the WM to update using gsettings. As elegant as an oil rig welding, but it works. sort of.

User avatar
Superannuated
Level 4
Level 4
Posts: 279
Joined: Wed Sep 16, 2015 1:18 am
Location: UTC -8 :: Pacific Coast USA

Re: I give up: How to change the title bar background color

Post by Superannuated » Wed Jan 17, 2018 3:57 am

I have no idea what you need to get your work done, but have you looked at gnome-color-chooser from the repos?

jonr
Level 1
Level 1
Posts: 2
Joined: Tue Jan 16, 2018 9:58 am

Re: I give up: How to change the title bar background color

Post by jonr » Thu Jan 18, 2018 10:38 am

Well, after few hours, lots of cursing, and countless google searches I made it: https://imgur.com/a/y0evZ

It works, but the code is horrible, and a lot of hard coding in there. I "only" need to change the metacity-1/metacity-theme-3.xml and force theme reload. thehorror.gif

The program itself is simple, it just run shell

Code: Select all

gsettings monitor org.cinnamon.desktop.background picture-uri
and waits for the background to change. Then I load the background and calculate 3 colours from it using algorithm I can't remember where came from. I pick the darkest color.

Then it checks what theme I'm using and modifies the <theme>/metacity-1/metacity-theme-3.xml file and and modifies few <constant> fields with the new hex value.

Then I call reset/set with gsettings.

Very ugly hack held together with bubble gum and twine.

Post Reply

Return to “Themes, Icons, & Wallpaper”