From db13b64fa0ab8c691bd8a2075612bac5d9568613 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 10 Apr 2024 19:06:52 +0800 Subject: i3status-wrapper: drop reopening STDIN --- scripts/desktop/i3status-wrapper | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/desktop/i3status-wrapper b/scripts/desktop/i3status-wrapper index 054e804a..201cdd7e 100755 --- a/scripts/desktop/i3status-wrapper +++ b/scripts/desktop/i3status-wrapper @@ -226,7 +226,6 @@ unless (fork // warn "couldn't fork command pipe reader") { } $pipe->reader; -open STDIN, "<&=", $pipe->fileno or die "couldn't reopen STDIN!"; # Following based on Michael Stapelberg's sample i3status-wrapper script. @@ -236,15 +235,15 @@ my $hostinfo = { name => "hostinfo", full_text => $username . "@" . $hostname }; # Skip the first line which contains the version header. -print scalar <>; +print scalar <$pipe>; # The second line contains the start of the infinite array. -print scalar <>; +print scalar <$pipe>; wsbuttons("no"); # Read lines forever, ignore a comma at the beginning if it exists. -while (my ($statusline) = (<> =~ /^,?(.*)/)) { +while (my ($statusline) = (<$pipe> =~ /^,?(.*)/)) { # If there is a decoding error, just skip this line, to minimise status # bar freezes. This should be fine here because this filtering loop is in # itself stateless. It's only if the decoding error involves newlines in -- cgit v1.2.3