fix coloring of serial ports with tty in name
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Nov 2017 12:53:19 +0000 (13:53 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Nov 2017 12:53:19 +0000 (13:53 +0100)
gpio.pl

diff --git a/gpio.pl b/gpio.pl
index 6df9d1f..1b1d981 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -241,6 +241,7 @@ sub svg_style {
        } elsif ( $name =~ m/\[(\w+)/ ) { # kernel
                my $dev = $1;
                my ($fg,$bg) = @{ $cols->{txt} };
+               $dev = 'serial' if $dev =~ m/^tty/;
                ($fg,$bg) = @{ $cols->{$dev} } if exists $cols->{$dev};
                rect $x,$y,$col,$bg;
                return qq{ style="fill:$fg"};