From 9b28ba7a5eabcc61d5d9891fa8cab3285a371788 Mon Sep 17 00:00:00 2001 From: Maxim Kolesnikov Date: Mon, 4 Apr 2022 17:49:13 +0700 Subject: [PATCH] fix(script): clear output when exec-if fails (#2675) Fixes #2674 --- CHANGELOG.md | 2 ++ src/adapters/script_runner.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f4936cd..160aadbe 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] +### Fixed +- `custom/script`: Output clearing when `exec-if` fails ([`#2674`](https://github.com/polybar/polybar/issues/2674)) ## [3.6.2] - 2022-04-03 ### Fixed diff --git a/src/adapters/script_runner.cpp b/src/adapters/script_runner.cpp index 23a791f4..c1742199 100644 --- a/src/adapters/script_runner.cpp +++ b/src/adapters/script_runner.cpp @@ -45,7 +45,10 @@ script_runner::interval script_runner::process() { } void script_runner::clear_output() { - set_output(""); + auto changed = set_output(""); + if (changed) { + m_on_update(m_data); + } } void script_runner::stop() {