aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmonitor-edid11
-rwxr-xr-xmonitor-parse-edid5
2 files changed, 11 insertions, 5 deletions
diff --git a/monitor-edid b/monitor-edid
index 5bc0bea..4dd6311 100755
--- a/monitor-edid
+++ b/monitor-edid
@@ -25,9 +25,14 @@ if ($0 =~ /monitor-get-edid/) {
foreach (@edids) {
my ($f, $edid) = @$_;
warn "parsing EDID from $f\n" if $opt{verbose};
- open(my $F, '|' . parse_edid());
- print $F $edid;
- close $F and $err = 0;
+ if ($f =~ m!^/!) {
+ system(parse_edid() . " $f");
+ $err = 0 if $? == 0;
+ } else {
+ open(my $F, '|' . parse_edid());
+ print $F $edid;
+ close $F and $err = 0;
+ }
print ",\n" if $opt{perl};
}
print ")\n" if $opt{perl};
diff --git a/monitor-parse-edid b/monitor-parse-edid
index 3d63b79..c542fe4 100755
--- a/monitor-parse-edid
+++ b/monitor-parse-edid
@@ -451,11 +451,11 @@ GetOptions(
'MonitorsDB' => \ (my $MonitorsDB),
) or usage();
-my $F;
+my ($file, $F);
if (@ARGV == 0) {
$F = *STDIN;
} elsif (@ARGV == 1) {
- open($F, $ARGV[0]) or usage();
+ open($F, $file = $ARGV[0]) or usage();
} else {
usage();
}
@@ -468,6 +468,7 @@ my $edid = parse_edid($raw_edid);
if (my $err = check_parsed_edid($edid)) {
die "$err\n";
}
+$edid->{file} = $file if $file;
if ($raw_perl) {
use Data::Dumper;