Closed eric-hansen closed 7 months ago
critical_bg
is used when command_{on,off}
fails.
What would I use then for when command_off succeeds like I'm trying to do
On Sun, Jul 23, 2023, 4:40 PM Max Verevkin @.***> wrote:
criticalbg is used when command{on,off} fails.
— Reply to this email directly, view it on GitHub https://github.com/greshake/i3status-rust/issues/1923#issuecomment-1646954696, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7DKZYPTCDFYITHPPVYVSTXRWD2HANCNFSM6AAAAAA2S5PO2I . You are receiving this because you authored the thread.Message ID: @.***>
It is not currently possible, state_{on,off}
options must be implemented similar to icon_{on,off}
.
From my understanding based on here: https://github.com/greshake/i3status-rust/blob/v0.31.8/src/blocks/toggle.rs#L129
If the status is "on" then
idle_bg
is used, and if the status is "off" thencritical_bg
is used.The determintor from
command_state
is whether the resulting command has text or if it's an empty string (https://github.com/greshake/i3status-rust/blob/v0.31.8/src/blocks/toggle.rs#L20).However, the tokio docs, if I'm reading it correctly, says that it's based on the exit code.
I'm not familiar w/ tokio and only a beginner at Rust, so maybe I'm missing something here, but the
critical_bg
override is never applied whencommand_state
returns an empty string or has exit code of 1.Here's my current block:
What I've also done is move the state command to a shell script and either do
exit 0
if the awk value == wg0 orexit 1
if it's not.So what I would expect to see is when the toggle is in this state, the bg is a red color. But instead it stays in idle bg regardless.
The toggle works, so the commands are fine and I can see it reflect in the NetworkManager applet and in the output of nmcli. So it's more so something is not working when trying to set the color.