artemsen / swaykbdd

Keyboard layout switcher for Sway
MIT License
72 stars 5 forks source link

Verbose output redirection doesn't work. #13

Closed mrplumber closed 1 month ago

mrplumber commented 1 month ago

I tried to pipe swaykbdd --verbose output to awk, but it seems I/O redirection does not work at all. Tried all sorts of redirection without success. Nothing gets redirected.

artemsen commented 1 month ago

This is a buffer effect. Typically the system flushes stdout when a line ends with a \n character. You can disable buffering for swaykbdd using the stdbuf utility:

stdbuf -o 0 swaykbdd --verbose | awk ...
mrplumber commented 1 month ago

TIL. That will do for me. Thanks.