yambar/modules/meson.build
Daniel Eklöf d576802e49
modules/sway-xkb: new module, uses sway 'input' events to expose kbd layout
We subscribe to Sway's 'input' events, and use these to expose input
devices' active XKB layout.

The module is configured by specifying a list of 'identifiers'; these
are the input devices (keyboards, typically), that we'll be
monitoring. All other input devices are ignored.

'content' is a template, and the module will instantiate a dynlist
with a 'content' for each *existing* input found in the 'identifiers'
list.

We also monitor for device 'added' and 'removed' events, and update
our internal list of existing inputs.

This means the user can configure a set of identifiers, and only those
that are actually present will be displayed. If a device that is
listed in the 'identifiers' list is added, it will be displayed. If it
is removed, it will no longer be displayed.
2019-08-14 21:51:43 +02:00

48 lines
1.3 KiB
Meson

module_sdk = declare_dependency(dependencies: [cairo, cairo_ft, threads])
modules = []
alsa = dependency('alsa')
udev = dependency('libudev')
json = dependency('json-c')
mpd = dependency('libmpdclient')
xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
# Module name -> (source-list, dep-list)
deps = {
'alsa': [[], [alsa]],
'backlight': [[], [udev]],
'battery': [[], [udev]],
'clock': [[], []],
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
'label': [[], []],
'mpd': [[], [mpd]],
'network': [[], []],
'removables': [[], [dynlist, udev]],
'sway_xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
}
if backend_x11
deps += {
'xkb': [[], [xcb_stuff, xcb_xkb]],
'xwindow': [[], [xcb_stuff]],
}
endif
foreach mod, data : deps
sources = data[0]
dep = data[1]
if plugs_as_libs
shared_module(mod, '@0@.c'.format(mod), sources,
dependencies: [module_sdk] + dep,
name_prefix: 'module_',
install: true,
install_dir: join_paths(get_option('libdir'), 'f00bar'))
else
modules += [declare_dependency(
sources: ['@0@.c'.format(mod)] + sources,
dependencies: [module_sdk] + dep,
compile_args: '-DHAVE_PLUGIN_@0@'.format(mod))]
endif
endforeach