File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,18 @@ Change the config.h file and you're good to go!
21
21
The text background and foreground are respectively the first and the second
22
22
entries in the palette (COLOR0 and COLOR1).
23
23
24
+ Colors
25
+ ------
26
+ Attached there's palette.pl, an handy tool that extracts a palette from your
27
+ X colors and returns it ready to be pasted in the configuration file.
28
+
29
+ ```
30
+ palette.pl <.Xresources / .Xdefaults path>
31
+ ```
32
+
33
+ If you keep your colors in a separate file just feed that file and you're good
34
+ to go.
35
+
24
36
Text formatting
25
37
---------------
26
38
All the format commands are preceded by a backslash (\\ ).
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env perl
2
+ #
3
+ # palette.pl
4
+ #
5
+ # Converts your .Xdefault/.Xresources colors into a ready to paste palette
6
+ # for bar. It takes your foreground/background settings into account and if
7
+ # it cant find them it leaves COLOR0/COLOR1 undefined.
8
+ #
9
+
10
+ use strict;
11
+ use warnings;
12
+
13
+ open (F, " <" .$ARGV [0]) || die " Can't open!" ;
14
+
15
+ while (<F>) {
16
+ if ($_ =~ m / ^\s *(?:\w +\. |\* )(color|background|foreground)(\d +)?\s *:\s *#([0-9A-Fa-f]*)/ ) {
17
+ if ($1 eq " background" ) {
18
+ printf " #define COLOR0\t 0x$3 \n " ;
19
+ }
20
+ elsif ($1 eq " foreground" ) {
21
+ printf " #define COLOR1\t 0x$3 \n "
22
+ }
23
+ elsif ($1 eq " color" && $2 < 8) {
24
+ printf " #define COLOR%i \t 0x$3 \n " , $2 + 2;
25
+ }
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments