Better error handling when getting sizehints fails
[notion.git] / mod_xkbevents / statusbar_xkbgroup.lua
blobe3bb1eefadac7d6f84dd4aab7630b7053fe1e01b
1 --[[
2 Author: Etan Reisner
3 Email: deryni@unreliablesource.net
4 Summary: Adds an xkbgroup statusbar meter.
5 License: MIT
6 Last Updated: 2011-05-09
8 Copyright (c) Etan Reisner 2011
9 --]]
11 local group_hook = ioncore.get_hook("xkb_group_event")
12 if not group_hook then
13 pcall(dopath, "mod_xkbevents")
14 group_hook = ioncore.get_hook("xkb_group_event")
15 if not group_hook then
16 warn("Could not load mod_xkbevents.")
17 return
18 end
19 end
21 local function group_event(tab)
22 if tab.group then
23 mod_statusbar.inform("xkbgroup", tostring(tab.group))
24 end
25 ioncore.defer(mod_statusbar.update)
26 end
28 group_hook:add(group_event)