File: statusbar_xkbgroup.lua

package info (click to toggle)
notion 4.0.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (28 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (8)
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)