xed themes and colors

Style your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
foberle
Level 3
Level 3
Posts: 127
Joined: Fri Oct 13, 2017 4:52 pm

xed themes and colors

Post by foberle »

Not sure if this belongs here or in apps, but I think it's cinnamon related ...

So-called "Dark Modes" are becoming increasingly popular, but many applications - including many popular and commonly used apps - don't yet support dark modes very well. For my question here, though, I'll stick with xed, since it's the default editor supplied with the Cinnamon Desktop (I'm using 5.6.7 and the Mint-Y flavors on LMDE by the way, and using xed's Cobalt theme).

Within xed, the theme is chosen by going to: Edit > Preferences > Theme and select Cobalt. On screen, this is quite nice looking and seems to be quite easy on the eyes, but when it comes to printing - some code for example - on regular old white paper, however, it's pretty horrible. Constants, such as function names, are printed in a very light yellow (which turns out to be something called "faded_yellow"), which is barely legible on white paper in good light.

When you think about it, the task of choosing a set of colors that will work successfully on both light and dark backgrounds and still remain distinct from each other sounds incredibly difficult, but xed does seem to make a token effort: text that is white on the screen (legible, good contrast, etc.) is rendered in black (ditto) on paper. The other colors, however, remain the same.

Thinking I had a great (though a bit tedious) solution to this issue, I had the idea to switch over to xed's Kate theme (white background) and print using that. I frequently use Kate and quickly noticed that the colors didn't match, but that wasn't a big deal. What was interesting was that the Kate theme displays a white cursor on a white background (hard to imagine any extensive usage testing there). So the printing "worked" but swapping themes to print didn't sound like a really great solution. <style name="def:comment" foreground="sky_blue"/>


So I thought I'd play around to "fine tune" just that one color as an experiment. I located what looked to be the xed styles and cobalt in /usr/share/gtksourceview-3.0/styles/cobalt.xml. In the early portion of the file, the color constants are listed: "faded_yellow" for example is right at the top of the Colors section.

Code: Select all

  <!-- Colors -->
  <color name="faded_yellow"                value="#ffee80"/>
A bit further down, the following assignment can be located:

Code: Select all

  <!-- Constants and Variables-->
  <style name="def:constant"                foreground="faded_yellow"/>
So I pressed 'Ctrl+Alt+T', then 'sudo xed /usr/share/gtksourceview-3.0/styles/cobalt.xml' and changed the previous line to

Code: Select all

  <style name="def:constant"                foreground="steel_grey"/>
(another color defined earlier) as a trial to see if that was a better compromise.

I also changed the earlier line

Code: Select all

  <style name="def:comment"                 foreground="sky_blue italic="true"/>
to

Code: Select all

  <style name="def:comment"                 foreground="sky_blue"/>
to remove the italics just so there would be a more obvious change to see on screen. These changes made no difference at all, after restarting xed, or restarting Cinnamon, or logging out and back in, or even rebooting.

The next step was to see if perhaps there was a local (user-specific) version of the xed theme configuration files that might have been overriding my change, but I looked in all the usual hidden home directories and didn't spot anything that seemed likely.

So does anyone have any thoughts or ideas? (Other than solutions like "don't print" or questions like "why do you want to print?"). Is there some sort of process that needs to be run to load these settings to somewhere else (sort of like update initramfs or update-grub require)? Thanks for any ideas.
Last edited by LockBot on Thu Jul 27, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
JosephM
Level 6
Level 6
Posts: 1463
Joined: Sun May 26, 2013 6:25 pm

Re: xed themes and colors

Post by JosephM »

Try instead changing the ones the gtksourceview-4 folder. It was ported to gtksourceview4 quite some time ago.
When I give opinions, they are my own. Not necessarily those of any other Linux Mint developer or the Linux Mint project as a whole.
foberle
Level 3
Level 3
Posts: 127
Joined: Fri Oct 13, 2017 4:52 pm

Re: xed themes and colors

Post by foberle »

Thanks much - I should have kept looking, but didn't realize the settings would be in multiple locations.

I made the changes just as I described in my original post, but only the formatting of the comments changed. That tells me that a) you were correct about the file I needed to edit, but b) I was wrong about which attribute determined the color of the function names. I should have continued reading, but (again) I stopped at faded_yellow (because it sure was faded on my printout), and didn't go any further. I'm suitably abashed for cutting corners.

So, more experimenting when I get a chance. The likely suspect (since the file in question was a bash script) seems to be a later stanza:

Code: Select all

  <!-- SH Styles -->
  <style name="sh:function"                 foreground="neon_yellow"/>
which I'll change after reading through the whole thing when I get a chance to make sure I haven't missed anything. If that works, I'll report back and set this to Solved.

Again, thanks for pointing me to the right place ...
Locked

Return to “Themes, Icons & Wallpaper”