12 open(my $rgb, '<', '/etc/X11/rgb.txt');
15 my $col = $1 if m{(\S+)\s*$};
16 next unless $col =~ m{Light};
17 push @cols, $col if $last_col ne $col;
23 my ( $name, $cmd ) = @_;
26 my $screenrc = "/tmp/$name.screenrc";
28 my ($autodetach,$detach) = $ENV{DISPLAY} ? ('off','') : ( 'on', 'detach' );
30 write_file $screenrc, qq|
32 autodetach $autodetach
40 logfile $log::dir/$name.log
47 my $screen = "screen -R $name -c $screenrc";
50 if ( $ENV{DISPLAY} ) {
52 $hash += ord($_) foreach ( split //, $name );
53 my $fg = $cols[ $hash % $#cols ];
54 $exec = "xterm -fg $fg -T '$name' -n '$name' -e '$screen'";
57 warn "system $screen";