Listing all color names

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#41 Post by MochiMoppel »

@misko: Your're right, it is a quoting issue, but not in the --dclick-action argument. Doesn't matter if escaped quotes are added to %s or not. What is crucial is the somewhat odd quoting required for printf. I tested with your script you posted on May 21 and I never suspected your code because it looks right. What causes the problems is

Code: Select all

printf '<span background="%s">\t\t</span>\n' "$col"
When you change it to

Code: Select all

printf "<span background='%s'>\t\t</span>\n" "$col"
or

Code: Select all

printf '%s\n' "<span background='$col'>		</span>"
everything works fine.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#42 Post by 01micko »

MochiMoppel wrote:Yes, rgb.txt is less essential than it used to be and AFAIK some distros have ditched it altogether, but as long as Puppy keeps a copy and as long as some applications use it, it should be accurate, shouldn't it? Keeping an outdated copy that was created 20 years ago (acc, to its header) in modern Puppies like bionicpub just makes no sense to me.
https://lists.x.org/archives/xorg-annou ... 02494.html There is rgb-1.0.6 - latest AFAIK - contains rgb.txt

MochiMoppel wrote:But apart from the content there is another issue that needs fixing:

Location of rgb.txt

Puppy default
the usual path to the file in Puppies is /usr/share/X11/rgb.txt, a location where no application I know would expect it.

netpbm utilities
The netpbm utilities expect rgb.txt to be in any of these locations:
/usr/lib/X11/rgb.txt
/usr/openwin/lib/rgb.txt
/usr/X11R6/lib/X11/rgb.txt


For reasons I don't know the devs didn't solve this issue by putting a symlink to /usr/share/X11/rgb.txt into one of these locations. Instead they tried to fix it with an entry in /etc/profile:

Code: Select all

#w468 netpbm utilities need to be told where rgb.txt is...
[ -f /usr/share/X11/rgb.txt ] && export RGBDEF=/usr/share/X11/rgb.txt
yad
For yad the default path is
/etc/X11/rgb.txt
With a symlink in this location the command

Code: Select all

yad --color --palette
would create a yad dialog with rgb.txt as its palette.

gcolor2
Like yad gcolor2 shows rgb.txt by default, but searches in additional locations:
/usr/X11R6/lib/X11/rgb.txt
/usr/lib/X11/rgb.txt
/etc/X11/rgb.txt
/usr/openwin/lib/X11/rgb.txt

Unlike yad gcolor2 does not allow user defined alternative paths, hence woof-CE's strange decision to allow the misuse of /root/.rgb.txt for this purpose. A simple symlink in one of the paths known to gcolor2 would enable gcolor2 to function as intended.

Bottomline
A few symlinks would rectify all issues associated with the current location
Symlinks /etc/X11/rgb.txt and /usr/lib/X11/rgb.txt added to woof-ce.
Puppy Linux Blog - contact me for access

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

#43 Post by MochiMoppel »

01micko wrote:Symlinks /etc/X11/rgb.txt and /usr/lib/X11/rgb.txt added to woof-ce.
Thank you.
Please don't forget to remove /root/.rgb.txt. It really shouldn't have been added in the first place. If you don't then gcolor2 will list all system colors twice.

Post Reply