summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2024-04-10 19:06:52 +0800
committerSean Whitton <spwhitton@spwhitton.name>2024-04-10 19:06:52 +0800
commitdb13b64fa0ab8c691bd8a2075612bac5d9568613 (patch)
treec3c9689c0757e49e6a1086b26bc2652e11371b59
parent08192cb0e667cb9eeb8e5760f57f97509490d871 (diff)
downloaddotfiles-db13b64fa0ab8c691bd8a2075612bac5d9568613.tar.gz
i3status-wrapper: drop reopening STDIN
-rwxr-xr-xscripts/desktop/i3status-wrapper7
1 files 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