-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
generate_xresources
executable file
·125 lines (93 loc) · 2.13 KB
/
generate_xresources
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/perl
# abstract: generate a hash with colorschemes from X resources
use vars qw($VERSION);
my $APP = '';
$VERSION = '0.003';
use strict;
use Data::Dumper;
{
package Data::Dumper;
no strict 'vars';
$Terse = $Indent = $Useqq = $Deparse = $Sortkeys = 1;
$Quotekeys = 0;
}
my $colors;
for my $file(@ARGV) {
open(my $fh, '<', $file) or die($!);
chomp( my @r = <$fh> );
@r = grep{/(\*color\d+:\s*#.+)/} @r;
for my $l(@r) {
print $l, "\n";
if($l =~ m/!?(?:\w+)?\*color(\d+):\s*#(.+)/) {
$colors->{$file}->{$1} = $2;
}
}
}
print Dumper $colors;
__DATA__
! .Xdefaults
! Colour scheme
*background:#1a1a1a
*foreground:#fff
*highlightColor:#444
*color0:#000000
*color1:#ff6565
*color2:#93d44f
*color3:#eab93d
*color4:#204a87
*color5:#ce5c00
*color6:#89b6e2
*color7:#cccccc
*color8:#555753
*color9:#ff8d8d
*color10:#c8e7a8
*color11:#ffc123
*color12:#3465a4
*color13:#f57900
*color14:#46a4ff
*color15:#ffffff
! Xft resources
Xft.antialias:true
Xft.dpi:96
Xft.hinting:true
! hintslight | hintsmedium | hintsfull
Xft.hintstyle:hintslight
! rgba subpixel hinting (for LCDs)
Xft.rgba:none
! Xterm resources
! Xft font name style
XTerm*faceName:Liberation Mono
XTerm*faceSize:9
! Enable 256 color
XTerm*termName:xterm-color
XTerm*cursorBlink:false
XTerm*utf8:1
XTerm*loginShell:true
! Fix some input and <Alt> for ncurses
XTerm*eightBitInput:false
XTerm*altSendsEscape:true
! Matches selection for URLs and emails when double-click
XTerm*charClass: 33:48,37-38:48,45-47:48,64:48,58:48,126:48,61:48,63:48,43:48,35:38
XTerm*trimSelection: true
! Sets Xcursor theme (installed under /usr/share/icons/ or ~/.icons/)
Xcursor.theme:Vanilla-DMZ-AA
=pod
=head1 NAME
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 OPTIONS
=head1 AUTHOR
Magnus Woldrich
CPAN ID: WOLDRICH
http://japh.se
=head1 REPORTING BUGS
Report bugs on rt.cpan.org or to [email protected]
=head1 COPYRIGHT
Copyright (C) 2011 Magnus Woldrich. All right reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
1;
# vim: set ts=2 et sw=2: