From 621ce8d773a2e3b6aef9d8d1b50e70c2c70db6c0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 12 Dec 2017 01:06:46 +0100 Subject: i3-conky-wrapper: Fix empty line detection; fix simple_mapping next breaking wrong loop Signed-off-by: Florian Pritz --- .i3/conky-wrapper.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.i3/conky-wrapper.pl b/.i3/conky-wrapper.pl index 2ab2925..da02291 100755 --- a/.i3/conky-wrapper.pl +++ b/.i3/conky-wrapper.pl @@ -29,10 +29,10 @@ my %simple_mappings = ( "SHORTTEXT" => "shorttext", ); -while (<$conky>) { +LINE: while (<$conky>) { chomp($_); - next if m/^\s+$/; + next if m/^\s*$/; if (m/^END_BLOCK$/) { STDOUT->printf("%s,\n", $json->encode(\@data)); @@ -48,7 +48,7 @@ while (<$conky>) { for my $key (keys %simple_mappings) { if (m/^$key: (.*)$/) { $in_progress{$simple_mappings{$key}} = $1; - next; + next LINE; } } -- cgit v1.2.3-24-g4f1b