summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-12 01:06:46 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-12-12 01:06:46 +0100
commit621ce8d773a2e3b6aef9d8d1b50e70c2c70db6c0 (patch)
tree25865c4e9d4a5bd5c646bba3bcbeb32cc93324a7
parent75827353b4ece85cb4e1e927404692f136b270b8 (diff)
downloaddotfiles-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.pl6
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;
}
}