From 36d19d372dfa1a0d0678d8593421dd2928c8ac73 Mon Sep 17 00:00:00 2001 From: indev Date: Sat, 2 Apr 2022 01:15:35 +0700 Subject: [PATCH] fix(script): do not hide failing scripts with constant output --- CHANGELOG.md | 2 ++ src/adapters/script_runner.cpp | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bb7897..db96e56e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Breaking +- `custom/script` now doesn't hide failing script if it's output is not changing ([`#2636`](https://github.com/polybar/polybar/issues/2636)). Somewhat similar behaviour can be imitated with `format-fail`, if necessary. ## [3.6.1] - 2022-03-05 ### Build diff --git a/src/adapters/script_runner.cpp b/src/adapters/script_runner.cpp index cec6e240..1cccc6a5 100644 --- a/src/adapters/script_runner.cpp +++ b/src/adapters/script_runner.cpp @@ -106,8 +106,6 @@ script_runner::interval script_runner::run() { int fd = cmd.get_stdout(PIPE_READ); assert(fd != -1); - bool changed = false; - bool got_output = false; while (!m_stopping && cmd.is_running() && !io_util::poll(fd, POLLHUP, 0)) { /** @@ -115,7 +113,7 @@ script_runner::interval script_runner::run() { * down, we still need to continue polling. */ if (io_util::poll_read(fd, 25) && !got_output) { - changed = set_output(cmd.readline()); + set_output(cmd.readline()); got_output = true; } } @@ -127,10 +125,6 @@ script_runner::interval script_runner::run() { m_exit_status = cmd.wait(); - if (!changed && m_exit_status != 0) { - clear_output(); - } - if (m_exit_status == 0) { return m_interval_success; } else {