/[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

Annotation of /lib/PXElator/x11.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 171 - (hide annotations)
Thu Aug 6 22:15:09 2009 UTC (14 years, 9 months ago) by dpavlin
File size: 502 byte(s)
and x11::xterm itself
1 dpavlin 171 package x11;
2    
3     use warnings;
4     use strict;
5    
6     my @cols;
7    
8     my $last_col = '';
9     open(my $rgb, '<', '/etc/X11/rgb.txt');
10     while(<$rgb>) {
11     chomp;
12     my (undef,$col) = split(/\s\s+/,$_,2);
13     next unless $col =~ m{Light};
14     push @cols, $col if $last_col ne $col;
15     $last_col = $col;
16     }
17     close($rgb);
18    
19     sub xterm {
20     my ( $name, $cmd ) = @_;
21    
22     my $fg = $cols[ unpack('C*', $name) % $#cols ];
23     my $exec = "xterm -fg $fg -T '$name' -n '$name' -e '$cmd || $server::base_dir/bin/beep.sh'";
24     warn "exec $exec";
25     exec $exec;
26     }
27    
28     1;

  ViewVC Help
Powered by ViewVC 1.1.26