I have two different keyboard layouts and I switch between them with Ctrl+Shift. And I want to display my current layout with i3blocks. Now I have a super small single-line script that returns current layout with the following command:
But how can I update information when switching between keyboards? What I've tried:
I could successfully update information by setting in i3blocks.conf:
... which forces my blocks to run the script every millisecond. It works ok but I'm really not sure it's the proper way to do that, particularly on the laptop.
I also tried to send a signal to the block when pressing Ctrl+Shift with something like this in my i3/config:
bindsym --release Control+Shift exec --no-startup-id pkill -RTMIN+8 i3blocks
And with the following lines in i3blocks.conf:
[language] interval=once signal=8
But I couldn't make it work. If I change
Control+Shift keys to any other key (for example
Control+1) it works ok.
(I mean, it sends a signal and updates blocks. If I switch keyboard with Ctrl+Shift and then press Mod+Shift+z or CapsLock or Ctrl+1 it will send a signal, update i3blocks and the language block will change).
I saw this post. It's also about switching the layouts. But I couldn't relate this to my problem. I'm not the best bash-programmer and don't understand what's going on in this kbdd-script. As far as I understand there's nothing about my problem.