0

On my awesomewm panel, I have added the keyboard layout object:

mykeyboardlayout = awful.widget.keyboardlayout()

It changes between two languages when I press Caps Lock:

localectl --no-convert set-x11-keymap gb,ara pc105 ,qwerty_digits grp:caps_toggle

How can I check in awesome which language is currently set ('ar' or 'gb') so that I can display a symbol instead of just text?

  • You could write your own widget. The code seems to use `awesome.xkb_get_group_names()` and connects to the `xkb::map_changed` and `xkb::group_changed` signals: https://github.com/awesomeWM/awesome/blob/1932bd017f1fd433a74f621d9fe836e355ec054a/lib/awful/widget/keyboardlayout.lua#L241 Oh and `awesome.xkb_get_layout_group()` – Uli Schlachter Nov 30 '21 at 16:33
  • Thank you Uli. But I don't think I currently have enough experience to write this widget. It's okay, I can live without it. –  Dec 04 '21 at 11:16

0 Answers0