vivien / i3blocks-contrib

Official repository for community contributed blocklets
https://github.com/vivien/i3blocks
Other
1.31k stars 486 forks source link

key_layout doesn't work because it doesn't output a \n at the end #470

Open Aster89 opened 2 years ago

Aster89 commented 2 years ago

Given

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     it

Expected behavior

$ ./key_layout/key_layout | sed -z 's/it\n/YES\n/;s/it/NO\n/'
YES

Actual behavior

$ ./key_layout/key_layout | sed -z 's/it\n/YES\n/;s/it/NO\n/'
NO

i3blocks config relevant to blocklet(s)

Irrelevant.

Output of blocklet(s) when run from command line

With reference to the example above, it instead of it\n.

Output of any relevant other commands that might help diagnostics

Aster89 commented 2 years ago

My fix would be to simply append | sed 's/$/\n/' to the existing command. Tested and works for me. Gimme a go and I'll PR it.