How can I modify gtk-dialog colours?

Using applications, configuring, problems
Message
Author
User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

How can I modify gtk-dialog colours?

#1 Post by Mike Walsh »

Morning, all.

I have a question about something that some of you are perhaps quite familiar with.

I know how to create on-screen "messages", either with pupmessage/gxmessage, or using gtk-dialog. Where these are used, you can set your own foreground (text) & background colours.

I ask because, in all seriousness, the two "flagship" Puppies, brilliant though they are (and obviously taking a lot of work, & TLC, from Phil B.) have, to my mind, just one real niggle:-

Who was it that thought black text on a dark green background was a good idea for system messages??? For those of us with 'poor' eyesight, it's not a good choice.....not at all. I'd like to modify this in my own system, but I need to know one thing; is there a 'global', default setting for this anywhere, or is it, as I suspect, set on an app-by-app basis?

Anybody know where I would look for this? Advice/help, etc, as always, will be much appreciated..!


Mike. :wink:

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#2 Post by bigpup »

menu->Desktop->JWMDesk Manager->
GTK Theme
JWM Theme

These do anything you are looking for?
Who was it that thought black text on a dark green background was a good idea for system messages???
I am not sure what you are looking at.
What program or terminal are you seeing this?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#3 Post by Mike Walsh »

Morning, bigpup.

No, I'm not talking about a terminal, or an application. I'm talking about like the wee infobar that comes up in the centre of the screen if, for instance, you've done something like mounting an SFS to look at the contents, or an ISO to do the same.

You can't take a screenshot of it, either - I've tried! - because as soon as anything else happens on screen, it disappears.....or times out.

But black text on a dark green background is NOT a good idea for those of us who have eyesight 'issues'..... I would imagine there's a way to do this, I'm just not sure where to look. In the pMount script, perhaps?


Mike. :wink:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

You mean this one? In newer Puppies this dialog will look a bit different (don't know which "flagships" you are talking about), but AFAIK background color green hasn't changed.
Attachments
Screenshot.png
(10.48 KiB) Downloaded 154 times

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#5 Post by Mike Walsh »

MochiMoppel wrote:You mean this one? In newer Puppies this dialog will look a bit different (don't know which "flagships" you are talking about), but AFAIK background color green hasn't changed.
Mm-hm! That's the one, Mochi.

Your picture is exactly how it looked when I used to run some of the older Puppies myself. Since upgrading to new hardware back in January, I can only run relatively modern Puppies, because of the UEFI stuff I'm now stuck with....

By 'flagships' I'm referring to Xenialpup64 & Bionicpup64. I also run radky's DPup 'Stretch' 7.5; these are the only ones I run now.

By messing around with the delay function in Take A Shot!, I've managed to get a snap of it. This is exactly how it appears in both Xenialpup64 and Bionicpup64 on this new hardware; I haven't modified it, enhanced it, or done anything to it:-


Image


Perhaps your eyesight is better than mine (which wouldn't be hard; I think most people's eyes are better than mine..!), but I find that pretty hard to read.

The only way to make it more 'readable' is to hike the gamma/brightness settings up the top of the scale.....but if I do that, the rest of the desktop is so washed-out it's nearly invisible.

Quite simply, I want to change the background colour, that's all. But I don't know where to look. Any advice would be much appreciated; I believe you know a bit more about gtk-dialog than most folks on the Forum...

(*shrug*)


Mike. :wink:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#6 Post by MochiMoppel »

Go to Geany. From "Tools" menu select "Color chooser". In Color chooser type in the color name green. What color do you get?

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#7 Post by fredx181 »

Hi Mike, I think the script to edit is /usr/sbin/filemnt (or filemnt in other PATH location perhaps)
Open with geany and search for 'green' and change "-bg green" to another color.
Or change the foreground color (default is black I think) by adding e.g. "-fg yellow" (without the quotes).
Probably hex color codes works too but needs surrounded by (double) quotes e.g.: -bg "#D1D5DA"

Fred
Last edited by fredx181 on Wed 01 Apr 2020, 14:12, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#8 Post by MochiMoppel »

fredx181 wrote:Open with geany and search for 'green' and change "-bg green" to another color.
Sure he can do this, but the real question is why the definition of "green" has changed. Should be #00FF00, and this definitely is not dark.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#9 Post by fredx181 »

MochiMoppel wrote:
fredx181 wrote:Open with geany and search for 'green' and change "-bg green" to another color.
Sure he can do this, but the real question is why the definition of "green" has changed. Should be #00FF00, and this definitely is not dark.
Ah, yes, that's the lighter green, when specifying -bg green at my gtkdialog splash it shows the darker green: #158916 EDIT: No #008000
Last edited by fredx181 on Wed 01 Apr 2020, 14:34, edited 2 times in total.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#10 Post by Mike Walsh »

Thanks for the replies, guys.

@ Mochi:- If I type "green" into Geany's color chooser, and hit Apply, the hex code I end up with is #008000.....OK? But it's a really dark green, for some reason. If I select a lighter green in the Color chooser - more like the image in your attachment - the code is, of course, completely and totally different.

@ Fred:- O-kay. /usr/bin/filemnt, you say? I'll take a butchers at it..... TBH, I don't really care which approach I take, whether it's leaving the text as-is, and making the background lighter, or leaving the background as-is, and making the text lighter. I would just like to able to read them when they come up.....and for that we need a bit of contrast!

(Before you say it, I know, I know; like you, I've seen the things come up a million times, and know what they say off by heart.....but it's the principle of the thing, y'know? :lol:)

Add to which I'm just a fussy bugger where appearances are concerned..... :oops: :roll:


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#11 Post by fredx181 »

Mike wrote: /usr/bin/filemnt, you say?
No, in /usr/sbin on Bionicpup64

@Mochi
box_splash -bg 'light green' gives me #90EE90 (according to yad --color using colorpicker)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#12 Post by Mike Walsh »

fredx181 wrote:
Mike wrote: /usr/bin/filemnt, you say?
in /usr/sbin on Bionicpup64
Sorry, Fred; I meant /usr/sbin! (It's April Fool's day here in the UK; whadd'ya expect..? :roll: :lol:)

Ya, I see the places that need alteration. I see only 'bg' is mentioned. When I use these myself, I normally specify both 'fg' and 'bg'. I assume that if 'fg' isn't specified, it'll default to black, yes?

And yes; I discovered about the need for quotation marks around hex values a while ago, when I was customizing the appearance of xload in the notification area of my Pups.....I like it about four times the width, different 'graph' colours and updating every 2 seconds. If you don't use quotation marks round the hex values, xload goes very.....'peculiar', that's all I can say!

I'll do some experimenting. Cheers for the pointers.


Mike. :wink:
Last edited by Mike Walsh on Wed 01 Apr 2020, 19:19, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#13 Post by MochiMoppel »

Mike Walsh wrote:@ Mochi:- If I type "green" into Geany's color chooser, and hit Apply, the hex code I end up with is #008000.....OK?
Of course not OK.
Your flagships are using the W3C color scheme instead of the X11 scheme. That's wrong. I tried to explain this here.
What however is strange is that /usr/share/X11/rgb.txt in Stretch7.5 defines green as "0 255 0 Green", which would be the lighter #00FF00, so why is green rendered as #00800? The flagship captains should know.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#14 Post by Mike Walsh »

@ Fred/all:-

This is better:-


Image


(I just made use of the same hex value I'd employed when putting together that silly utility last year for opening/closing your optical drive tray. Re-use, recycle.....call it what you like, it's done the trick..!) :)


Mike. :wink:

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#15 Post by Mike Walsh »

@ Mochi:-

Here's a GIF, showing what happens when I enter 'green' into Geany's Color Chooser in Bionic64:-


Image


I will confess, the top image, shared through PostImage, seems a bit darker for some reason. I'm certainly not blaming them for it.....they usually give sterling service. Dunno.


Mike. :wink:

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#16 Post by SFR »

MochiMoppel wrote:
Mike Walsh wrote:@ Mochi:- If I type "green" into Geany's color chooser, and hit Apply, the hex code I end up with is #008000.....OK?
Of course not OK.
Your flagships are using the W3C color scheme instead of the X11 scheme. That's wrong. I tried to explain this here.
What however is strange is that /usr/share/X11/rgb.txt in Stretch7.5 defines green as "0 255 0 Green", which would be the lighter #00FF00, so why is green rendered as #00800? The flagship captains should know.
Interesting, same happens in Fatdog.
It seems that GTK uses Pango to convert color names to hex values and source shows that Pango has its own RGB definitions:

Code: Select all

# grep 'green$' pango-1.42.4/tools/rgb.txt 
  0 128   0		green
#
It was added in v1.31.1 (http://ftp.gnome.org/pub/GNOME/sources/ ... .1.changes):
commit 633466d81ce094f8aadd562a51d16e150bb4037d
Author: Behdad Esfahbod <behdad@behdad.org>
Date: Sat Aug 25 15:46:21 2012 -0400

Add rgb.txt from X11

tools/Makefile.am | 3 +-
tools/rgb.txt | 753
++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 755 insertions(+), 1 deletion(-)
But either something went wrong, or maybe the X11 definitions were different at that time..?

[EDIT] They changed it deliberately: https://github.com/GNOME/pango/commit/d ... a7aff3112f

Ahoy!
Last edited by SFR on Wed 01 Apr 2020, 20:04, edited 1 time in total.
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#17 Post by fredx181 »

Oh boy, the flagship captains are fooling us !! :lol:

Terry H
Posts: 708
Joined: Sun 29 Mar 2009, 16:48
Location: The Heart of Muskoka, ON Canada

#18 Post by Terry H »

Here you go, lines 298 - 326 extracted from /usr/share/rgb.txt (in EasyPup) explains how #008000 is used for green. This differs from /usr/share/X11/rgb.txt, which does not contain these definitions.

Code: Select all

# From HTML 4.0 specification.  These are colors you can specify by name
# in HTML tags.
#
# Actually, these are the colors as if HTML's sRGB values were actually
# Rec. 709.  E.g. HTML 4.0 says silver is r=192, g=192, b=192, in the
# SRGB system.
# This file, which by definition contains Rec. 709 values, shows the same
# three numbers (192,192,192).  So this file defines a slightly different
# color than HTML does.
#
# There's some extension to HTML, apparently not blessed by W3C, that adds
# all the MIT colors (see above).  Internet Explorer can render all of them.

000 000 000 Black
192 192 192 Silver
128 128 128 Gray
255 255 255 White
128 000 000 Maroon
255 000 000 Red
128 000 128 Purple
255 000 255 Fuchsia
000 128 000 Green
000 255 000 Lime
128 128 000 Olive
255 255 000 Yellow
000 000 128 Navy
000 000 255 Blue
000 128 128 Teal
000 255 255 Aqua

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#19 Post by bigpup »

/usr/sbin/filemnt

I changed mine to yellow background with black font.

There was two different code lines for bg green, that had to be changed.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#20 Post by Mike Walsh »

bigpup wrote:/usr/sbin/filemnt

I changed mine to yellow background with black font.

There was two different code lines for bg green, that had to be changed.
TBH, I've dialled my own green back & down several shades & degrees of brightness; it's a pale, lemony-green now, more restful on the eyes. The way it was earlier this afternoon, it was more than a little "in yer face"..! :oops:


Mike. :wink:

Post Reply