xcolorize

Submitted scripts and programs
Forum rules
Your own work only.
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

xcolorize

Unread post by machinebacon » Fri Oct 03, 2014 10:47 am

If you want to create xcolors from scratch, this script might help. You need yad (it's in our repos) because gcolor2's color picker does not send the selected color to stdout.

Code: Select all

#!/bin/bash
# loops through color0-15 and opens color picker dialog
# depends on: yad

echo "Creating tempfile"
tmpfile=~/xcol.$$

declare -a cn1=(black red green yellow blue magenta cyan white bold_black bold_red bold_green bold_yellow bold_blue bold_magenta bold_cyan bold_white)

echo "Pick background color"
printf "*background: " >> $tmpfile
yad --color --title "Background color selection" >> $tmpfile
echo "Pick foreground color"
printf "*foreground: " >> $tmpfile
yad --color --title "Foreground color selection" >> $tmpfile

for n in {0..15}; do
	echo "Pick color $n for ${cn1[$n]}"
	printf "*color$n: " >> $tmpfile
	yad --color --title "Color selection for ${cn1[$n]}" >> $tmpfile
done

echo "Rename $tmpfile and merge it in ~/.Xresources"
exit 0
The script first asks you for the background and foreground colors, then goes through the normal and bold variants from black to white, each time opening the color picker tool. This is helpful if you want to stay close to the standard colors, rather than the automatized output of the paletterX tool.
..gnutella..

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: xcolorize

Unread post by rhowaldt » Fri Oct 03, 2014 1:38 pm

^ cool :)
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
alexender
Distrowatcher
Posts: 1
Joined: Thu Nov 20, 2014 7:05 am

Re: xcolorize

Unread post by alexender » Thu Nov 20, 2014 7:09 am

yad --color --title "Background color selection" >> $tmpfile..........!
kaleem

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: xcolorize

Unread post by DebianJoe » Thu Nov 20, 2014 7:18 am

Welcome, Alexender, to the BBQ. Please head over to /dev/null and make a short introduction, as it's much easier to take bash-script masters seriously once we get to know you. :)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: xcolorize

Unread post by machinebacon » Thu Nov 20, 2014 3:09 pm

I bet a warm PBR that alexender is a bot. (notepad/9wm/bash/xterm/what? are the default profile settings)
..gnutella..

Post Reply