/[pxelator]/lib/PXElator/x11.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/x11.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 213 by dpavlin, Wed Aug 12 01:29:11 2009 UTC revision 214 by dpavlin, Thu Aug 13 12:42:46 2009 UTC
# Line 12  my $last_col = ''; Line 12  my $last_col = '';
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;
# Line 47  $detach Line 47  $detach
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;

Legend:
Removed from v.213  
changed lines
  Added in v.214

  ViewVC Help
Powered by ViewVC 1.1.26