diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-12-12 01:06:46 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-12-12 01:06:46 +0100 |
commit | 621ce8d773a2e3b6aef9d8d1b50e70c2c70db6c0 (patch) | |
tree | 25865c4e9d4a5bd5c646bba3bcbeb32cc93324a7 | |
parent | 75827353b4ece85cb4e1e927404692f136b270b8 (diff) | |
download | dotfiles-621ce8d773a2e3b6aef9d8d1b50e70c2c70db6c0.tar.gz dotfiles-621ce8d773a2e3b6aef9d8d1b50e70c2c70db6c0.tar.xz |
i3-conky-wrapper: Fix empty line detection; fix simple_mapping next breaking wrong loop
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | .i3/conky-wrapper.pl | 6 |
1 files 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; } } |