0

I am writing a GNOME shell extension in gjs (JavaScript) that changes the color of the title in a GNOME shell application window depending on what the text says.

Right now, I am trying to get this working for Text Editor. I want to change the title color to red when the title (which is the name of the file currently in focus) ends in .js, blue when it ends in .txt, and green otherwise. It's a trivial program, but I'm hoping to eventually extend it to other applications for more meaningful purposes.

For example, viewing a .css file in Text Editor would make the title green:

green title

So far, I can get the title of the currently focused window and parse it to get its extension.

What I am stuck on is changing the color of the title. I'm not sure what the best way to do this would be. Some ideas I've tried are:

  • Changing the CSS properties of the title directly
  • Dynamically changing and updating the GTK theme

Even if one of these approaches is possible, I can't find any examples or documentation online.Can someone please point me in the right direction?

0 Answers0