Guest User

Untitled

a guest
Apr 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. -- Keyboard layout widget
  2. kbdwidget = widget({type = "textbox", name = "kbdwidget"})
  3. kbdwidget.border_width = 1
  4. kbdwidget.border_color = beautiful.fg_normal
  5. kbdwidget.text = " Eng "
  6.  
  7.  
  8. dbus.request_name("session", "ru.gentoo.kbdd")
  9. dbus.add_match("session", "interface='ru.gentoo.kbdd',member='layoutChanged'")
  10. dbus.add_signal("ru.gentoo.kbdd", function(...)
  11. local data = {...}
  12. local layout = data[2]
  13. lts = {[0] = "Eng", [1] = "Рус"}
  14. kbdwidget.text = " "..lts[layout].." "
  15. end
  16. )
Add Comment
Please, Sign In to add comment