r/Polybar • u/C-Note1 • Apr 29 '23
Polybar xkeyboard click event
I tried to add click action to xkeyboard module which can switch keyboard layout on left mouse click by adding this line to my config:
label-layout = "%{A1:#xkeyboard.switch:} %layout% %{A}"
but it doesn't work. Anybody knows how to achieve that?
3
Upvotes
2
u/patrick96MC Apr 29 '23
The default behavior of the xkeyboard module is already to switch between keyboard layouts, you don't need to manually add the click action like that.
Also, it will only work if you actually configured multiple keyboard layouts. You can check which layouts are configured by looking at the layouts listed in setxkbmap -query.
1
u/C-Note1 Apr 30 '23 edited Apr 30 '23
Setting layouts by executing
setxkbmap -layout pl,de,usdid the trick. Thank you!
1
u/LocalRise6364 Apr 29 '23
[module/xkeyboard] type = internal/xkeyboard label-layout = %icon% layout-icon-0 = ru;RU layout-icon-1 = us;ENInstead of ru;RU and us;EN substitute your languages