File: statusbar_xkbgroup.lua

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (28 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--[[
Author: Etan Reisner
Email: deryni@unreliablesource.net
Summary: Adds an xkbgroup statusbar meter.
License: MIT
Last Updated: 2011-05-09

Copyright (c) Etan Reisner 2011
--]]

local group_hook = ioncore.get_hook("xkb_group_event")
if not group_hook then
    pcall(dopath, "mod_xkbevents")
    group_hook = ioncore.get_hook("xkb_group_event")
    if not group_hook then
        warn("Could not load mod_xkbevents.")
        return
    end
end

local function group_event(tab)
    if tab.group then
        mod_statusbar.inform("xkbgroup", tostring(tab.group))
    end
    ioncore.defer(mod_statusbar.update)
end

group_hook:add(group_event)