How to tweak/customize GTK theme?

I installed Ubuntu with Unity desktop environment and then I installed GTK Theme, which is called Numix Dark. I really like the theme, but I would love to change some colors of the theme. I want to change the accent color from red to blue and change folders color from yellow to blue.

If someone could tell me how to do that would be really grateful. Do I have to only just change some text in a file in order to do that ?

After some Googling I found a thread that explains how to change the accent color from red to blue, but it didn't change all the colors from red to blue. And I still don't know how to make the folders blue.

After following the steps on I changed the accent color from red to blue,like so:

Current progress

But I couldn't change the controls that minimize, resize and close a window from red to blue. See this image to see what I'm talking about.

Screenshot

If would be really happy if you could tell me how to change window control colors from red to blue when hovered. Thank you.


Solution 1:

Remember when you were installing the GTK+ themes how you were hit with a .tar file. If you extract that file, you will get a magical folder of files. If you read the comments in each of the file, and if you know a little bit of the language, then you can easily start tweaking the themes...

For your purpose of just changing colors, it shouldn't be that hard to change the color, but again, I don't know which theme package you are dealing with, so just burn through the code and learn!

If on the other hand, you were looking for a GUI tool which you could use, there is none.

Solution 2:

There is not standard method for this and it is a lengthy process
You have to make changes in CSS files of theme which can be found it /usr/share/themes/<theme name>/.

Now here look for the colour you want to change, most probably it will be defined at the beginning of CSS file. You might wanna use a colour picker for this Agave is good.

After you found the colour to replace, run the following command

cd /usr/share/themes/<theme name>/
find . -type f | xargs sed -i 's/abc/xyz/g'

in above command replace abc with the colour name you dont want to see, and replce xyz with the colour you would like to see.

It would replace all occurrence of old colour in all files