12 |
open(my $rgb, '<', '/etc/X11/rgb.txt'); |
open(my $rgb, '<', '/etc/X11/rgb.txt'); |
13 |
while(<$rgb>) { |
while(<$rgb>) { |
14 |
chomp; |
chomp; |
15 |
my (undef,$col) = split(/\s\s+/,$_,2); |
my $col = $1 if m{(\S+)\s*$}; |
16 |
next unless $col =~ m{Light}; |
next unless $col =~ m{Light}; |
17 |
push @cols, $col if $last_col ne $col; |
push @cols, $col if $last_col ne $col; |
18 |
$last_col = $col; |
$last_col = $col; |
47 |
my $exec; |
my $exec; |
48 |
|
|
49 |
if ( $ENV{DISPLAY} ) { |
if ( $ENV{DISPLAY} ) { |
50 |
my $fg = $cols[ unpack('C*', $name) % $#cols ]; |
my $hash; |
51 |
|
$hash += ord($_) foreach ( split //, $name ); |
52 |
|
my $fg = $cols[ $hash % $#cols ]; |
53 |
$exec = "xterm -fg $fg -T '$name' -n '$name' -e '$screen'"; |
$exec = "xterm -fg $fg -T '$name' -n '$name' -e '$screen'"; |
54 |
|
warn "XXXX $exec"; |
55 |
} else { |
} else { |
56 |
warn "system $screen"; |
warn "system $screen"; |
57 |
system $screen; |
system $screen; |