-
-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: module/ipc: The literal '%output%' is displayed until output is received or the command terminates (initial hook only) #3131
Comments
This seems to fix it: diff --git a/src/modules/ipc.cpp b/src/modules/ipc.cpp
index 9e337020..9bafe229 100644
--- a/src/modules/ipc.cpp
b/src/modules/ipc.cpp
@@ -231,16 231,17 @@ namespace modules {
assert(h >= 0 && (size_t)h < m_hooks.size());
m_current_hook = h;
exec_hook();
}
void ipc_module::exec_hook() {
// Clear the output in case the command produces no output
m_output.clear();
update_output();
try {
command<output_policy::REDIRECTED> cmd(m_log, m_hooks[m_current_hook]->command);
cmd.exec(false);
cmd.tail([this](string line) { m_output = line; });
} catch (const exception& err) {
m_log.err("%s: Failed to execute hook command (err: %s)", name(), err.what());
m_output.clear(); But I don't think I know what I'm doing so I'm not going to send a PR. |
Hey, thanks for looking into this. Your solution indeed works (but there are some subtle interactions that cause it to not break anything when anything except the initial hook is executed). I think it makes more sense to call an initial |
Before, it just showed '%output%' Fixes polybar#3131
Before, it just showed '%output%' Fixes polybar#3131
Before, it just showed '%output%' Fixes polybar#3131
Before, it just showed '%output%' Fixes #3131
Fixed in #3140. The changes are not on master yet, they will be in the 3.7.2 release |
Thank you!! |
Checklist
Steps to reproduce
polybar example
%output%
is displayed until 5 seconds passMinimal config
Polybar log
Expected behavior
When using
module/ipc
withinitial
set to a hook, there should be no text on the bar until the hook has output something or the command finishes runningActual behavior
The text
%output%
is displayed until output is received. Sometimes when there is no output and the command exits the text%output%
stays there indefinitely, but I haven't been able to reproduce with a simple config. Usually it disappears when either there's output or the command finishes running.This doesn't happen when sending an action/hook. It only happens when running the initial hook.
Window Manager and Version
i3-gaps 4.23 (2023-10-29)
Linux Distribution
NixOS 24.05
Polybar version
Additional Context / Screenshots
No response
The text was updated successfully, but these errors were encountered: