--- lib/PXElator/x11.pm 2009/08/13 12:06:35 213 +++ lib/PXElator/x11.pm 2009/08/13 12:42:46 214 @@ -12,7 +12,7 @@ open(my $rgb, '<', '/etc/X11/rgb.txt'); while(<$rgb>) { chomp; - my (undef,$col) = split(/\s\s+/,$_,2); + my $col = $1 if m{(\S+)\s*$}; next unless $col =~ m{Light}; push @cols, $col if $last_col ne $col; $last_col = $col; @@ -47,8 +47,11 @@ my $exec; if ( $ENV{DISPLAY} ) { - my $fg = $cols[ unpack('C*', $name) % $#cols ]; + my $hash; + $hash += ord($_) foreach ( split //, $name ); + my $fg = $cols[ $hash % $#cols ]; $exec = "xterm -fg $fg -T '$name' -n '$name' -e '$screen'"; +warn "XXXX $exec"; } else { warn "system $screen"; system $screen;