Easy for a simpleton like myself. Looks goodMochiMoppel wrote:OK, here is my prototype for a yad color picker with save capability.
I have added up to 15 colors in the save window (program will do more)
.
Easy for a simpleton like myself. Looks goodMochiMoppel wrote:OK, here is my prototype for a yad color picker with save capability.
Only if the user runs yadcolmgr first where directory /root/.config/yadcol is created.Argolance wrote:Your script is in the PET under the name "yadcol", with small changes so that the configuration files are stored persistently in /root/.config/yadcol
Can't say much about it as it wouldn't work for me. I think it is hard coded to read /root/.jwm/jwmrc-theme, a file I don't use. My theme settings are in /root/jwmrc.I also provide a script that I made for my own use a long time ago and that allows to extract colors from the current JWM theme. The colors can be dragged and dropped directly into the Yadcol window and a palette can be created this way.
Thanks for your comment: better late than never!MochiMoppel wrote:Sorry for the late response.
May be indeed...I tried your scripts but didn't spend much time with them. That may be the reason why I couldn't really figure out how they work
I don't know if I understood you correctly, but it seems to me that's exactly what yadcolmgr does: Create, manage and instantly load selected palette using your script yadcol (please, see the picture below). Of course, user can also, if it is useful, edit the palette of his choice in the text editor to remove duplicate colors, for example, or rename them, or convert a standard palette into a GIMP palette, as well as browse to the palettes directory to rename them, but these are additional conveniences... Maybe I should change the text in the tooltip to make it clearer?Selecting a palette from your dropdown box could automatically populate the color picker and allow instant editing without the need for text files.
What strange kind of Puppy do you use? Is there any, using JWM that doesn't have its hidden /root/.jwm folder where its themes are stored?Can't say much about it as it wouldn't work for me. I think it is hard coded to read /root/.jwm/jwmrc-theme, a file I don't use. My theme settings are in /root/jwmrc.
No, that's not what I meant. My idea was to have the dropdown and the whole managing stuff in the original yad script, so there would be no need for a separate managing tool. I'm a simple minded single script guy My yad skills are getting rusty but I'll see if I can produce a demo. May take a couple of days. I understand that your solution works for you and certainly for many other users, so please don't pay too much attention to my views. Diversity is always good and my personal preferences don't matter much.Argolance wrote:I don't know if I understood you correctly, but it seems to me that's exactly what yadcolmgr does
Without diversity, this world would be hell itself! Uniformity is the enemy of humans, that's why I don't like so much the world we are building. That's why, among other things much more fundamental, I like our little Puppy .MochiMoppel wrote:Diversity is always good and my personal preferences don't matter much.
Code: Select all
busybox strings -n3 $(type -p Xorg) | grep -m1 -A751 alice
Code: Select all
busybox strings -n3 $(type -p Xorg) | grep -m1 -A751 alice |awk 'BEGIN {
print "<window title=\"Color Names as per Xorg\"><vbox><vbox width=\"250\" height=\"400\" scrollable=\"true\"><vbox>"}
++i==400 {print "</vbox><vbox>"} #start 400th item in new vbox to avoid segmentation fault
{print "<hbox><colorbutton><variable>\""$0"\"</variable><default>"$0"</default></colorbutton><entry><input>echo \" "$0"\"</input></entry></hbox>"}
END {print "</vbox></vbox><button></button></vbox></window>"}' | gtkdialog -s
Code: Select all
AliceBlue="#f0f8ff"
AntiqueWhite="#faebd7"
AntiqueWhite1="#ffefdb"
AntiqueWhite2="#eedfcc"
AntiqueWhite3="#cdc0b0"
AntiqueWhite4="#8b8378"
alice blue="#f0f8ff"
antique white="#faebd7"
aquamarine="#7fffd4"
aquamarine1="#7fffd4"
aquamarine2="#76eec6"
aquamarine3="#66cdaa"
aquamarine4="#458b74"
azure="#f0ffff"
[...]
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
Code: Select all
yad --color --palette
Code: Select all
printf '<span background="%s">\t\t</span>\n' "$col" | yad --list --column=color
Code: Select all
printf '<span background="%s">\t\t</span>\n' "#000" | yad --list --column=color
Code: Select all
#!/bin/bash
COLORS="$(busybox strings -n3 $(type -p Xorg) | grep -m1 -A751 alice)"
yadkey="$((${RANDOM} * $$))"
yad --color --plug=${yadkey} --tabnum=1 --gtk-palette --expand-palette --palette=/usr/share/X11/rgb.txt &
OIFS=$IFS
IFS=$'\n'
for col in $COLORS
do
printf '<span background="%s">\t\t</span>\n' "$col"
echo "$col"
done | yad --plug=${yadkey} --tabnum=2 --list --column=X11color --column=name --print-column=2 &
IFS=$OIFS
yad --paned --key="${yadkey}" \
--title="Color" --width=500 --height=700
Nice trick. I like the clean look of the yad list. Unfortunately the use of pango can lead to unexpected results. I tried to use --dclick-actionmisko_2083 wrote:Yad list can be used to display color. Either with@fore@ or @back@ column or with this trick with the pango markup
Code: Select all
--dclick-action='bash -c "gxmessage %s"'
What happens when you replace regular spaces with one of those from Unicode?MochiMoppel wrote:Nice trick. I like the clean look of the yad list. Unfortunately the use of pango can lead to unexpected results. I tried to use --dclick-actionmisko_2083 wrote:Yad list can be used to display color. Either with@fore@ or @back@ column or with this trick with the pango markupWith color names containing spaces yad crashes. Unspaced color names work fine. Doesn't seem to be a quotation issue.Code: Select all
--dclick-action='bash -c "gxmessage %s"'
I think going through the shell isn't necessary. With --dclick-action=gxmessage and nothing else it works for 'alice blue' and AliceBlue alike.blue> ' 'alice blue': -c: line 0: unexpected EOF while looking for matching `''
blue> ' 'alice blue': -c: line 1: syntax error: unexpected end of file
Code: Select all
function ehoyad () { yad --width=600 --title="$@"; }
export -f ehoyad
printf "<span background='%s'>\t\t</span>\n%s\n" "slate gray" "slate gray" | yad --list --column=color --column=name --dclick-action='bash -c "ehoyad \"%s\""'