You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to cut down the output of kbdd_layout down to only the first 2 characters of the active keyboard layout.
My modifications work in terminal, the output is indeed what I want, but somehow i3blocks doesn't update properly.
# Parse dbus output
dbus-monitor "interface='ru.gentoo.kbdd',member='layoutNameChanged'" | sed -un '0~2p' | \
sed -un 's:.*string "\(.*\)".*:\1:p' | sed -u '/:/d' | sed -r 's/(.{2}).*/\1/'
Even if I replace the last sed by a cut -c '1-2', i3blocks doesn't update the output properly. Only this modification on line 41 makes this blocks to not work right. That last operation is causing issues, no matter which one it is...
Am I missing something obvious?
The text was updated successfully, but these errors were encountered:
Since your changes work on the command line but not when called from i3blocks, I believe you are missing the fact that commands like sed have tricky caching optimizations that stop it from flushing stdout until some huge amount of data is accumulated first. Try using stdbuf, see e.g. https://github.com/vivien/i3blocks-contrib/blob/master/bandwidth/bandwidth, to stop commands doing such buffering.
I've been trying to cut down the output of kbdd_layout down to only the first 2 characters of the active keyboard layout.
My modifications work in terminal, the output is indeed what I want, but somehow i3blocks doesn't update properly.
First modification on line 37:
This works in i3blocks fine, I get "En" as expected for the initial state.
But then, my second modification on line 41:
Even if I replace the last
sed
by acut -c '1-2'
, i3blocks doesn't update the output properly. Only this modification on line 41 makes this blocks to not work right. That last operation is causing issues, no matter which one it is...Am I missing something obvious?
The text was updated successfully, but these errors were encountered: