mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 11:35:42 +02:00
meson: make ‘script’ plugin compile time optional
This commit is contained in:
parent
eb26f64ea7
commit
ec9ed66b6b
4 changed files with 30 additions and 17 deletions
|
@ -144,9 +144,10 @@ yambar = executable(
|
|||
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
||||
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
||||
plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [],
|
||||
plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [],
|
||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
||||
plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [],
|
||||
plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [],
|
||||
],
|
||||
build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles',
|
||||
export_dynamic: true,
|
||||
|
@ -197,9 +198,10 @@ summary(
|
|||
'i3+Sway': plugin_i3_enabled,
|
||||
'Label': plugin_label_enabled,
|
||||
'Network monitoring': plugin_network_enabled,
|
||||
'Removables monitoring': plugin_removables_enabled,
|
||||
'Pipewire': plugin_pipewire_enabled,
|
||||
'PulseAudio': plugin_pulse_enabled,
|
||||
'Removables monitoring': plugin_removables_enabled,
|
||||
'Script': plugin_script_enabled,
|
||||
},
|
||||
section: 'Optional modules',
|
||||
bool_yn: true
|
||||
|
|
|
@ -32,6 +32,8 @@ option('plugin-network', type: 'feature', value: 'auto',
|
|||
description: 'Network monitoring support')
|
||||
option('plugin-removables', type: 'feature', value: 'auto',
|
||||
description: 'Removables (USB sticks, CD-ROM etc) monitoring support')
|
||||
option('plugin-script', type: 'feature', value: 'auto',
|
||||
description: 'Script support')
|
||||
option('plugin-pipewire', type: 'feature', value: 'auto',
|
||||
description: 'Pipewire support')
|
||||
option('plugin-pulse', type: 'feature', value: 'auto',
|
||||
|
|
|
@ -32,6 +32,8 @@ plugin_network_enabled = get_option('plugin-network').allowed()
|
|||
udev_removables = dependency('udev', required: get_option('plugin-removables'))
|
||||
plugin_removables_enabled = udev_removables.found()
|
||||
|
||||
plugin_script_enabled = get_option('plugin-script').allowed()
|
||||
|
||||
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
||||
plugin_pipewire_enabled = pipewire.found()
|
||||
|
||||
|
@ -42,7 +44,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
|||
|
||||
# Module name -> (source-list, dep-list)
|
||||
mod_data = {
|
||||
'script': [[], []],
|
||||
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||
}
|
||||
|
||||
|
@ -94,10 +95,6 @@ if plugin_network_enabled
|
|||
mod_data += {'network': [[], []]}
|
||||
endif
|
||||
|
||||
if plugin_removables_enabled
|
||||
mod_data += {'removables': [[], [dynlist, udev_removables]]}
|
||||
endif
|
||||
|
||||
if plugin_pipewire_enabled
|
||||
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
||||
endif
|
||||
|
@ -106,6 +103,14 @@ if plugin_pulse_enabled
|
|||
mod_data += {'pulse': [[], [pulse]]}
|
||||
endif
|
||||
|
||||
if plugin_removables_enabled
|
||||
mod_data += {'removables': [[], [dynlist, udev_removables]]}
|
||||
endif
|
||||
|
||||
if plugin_script_enabled
|
||||
mod_data += {'script': [[], []]}
|
||||
endif
|
||||
|
||||
if backend_x11
|
||||
mod_data += {
|
||||
'xkb': [[], [xcb_stuff, xcb_xkb]],
|
||||
|
|
24
plugin.c
24
plugin.c
|
@ -69,18 +69,20 @@ EXTERN_MODULE(label);
|
|||
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||
EXTERN_MODULE(network);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||
EXTERN_MODULE(removables);
|
||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||
EXTERN_MODULE(pipewire);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_PULSE)
|
||||
EXTERN_MODULE(pulse);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||
EXTERN_MODULE(pipewire);
|
||||
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||
EXTERN_MODULE(removables);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_SCRIPT)
|
||||
EXTERN_MODULE(script);
|
||||
#endif
|
||||
EXTERN_MODULE(river);
|
||||
EXTERN_MODULE(sway_xkb);
|
||||
EXTERN_MODULE(script);
|
||||
EXTERN_MODULE(xkb);
|
||||
EXTERN_MODULE(xwindow);
|
||||
|
||||
|
@ -185,20 +187,22 @@ init(void)
|
|||
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||
REGISTER_CORE_MODULE(network, network);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||
REGISTER_CORE_MODULE(removables, removables);
|
||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||
REGISTER_CORE_MODULE(pipewire, pipewire);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_PULSE)
|
||||
REGISTER_CORE_MODULE(pulse, pulse);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||
REGISTER_CORE_MODULE(pipewire, pipewire);
|
||||
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||
REGISTER_CORE_MODULE(removables, removables);
|
||||
#endif
|
||||
#if defined(PLUGIN_ENABLED_SCRIPT)
|
||||
REGISTER_CORE_MODULE(script, script);
|
||||
#endif
|
||||
#if defined(HAVE_PLUGIN_river)
|
||||
REGISTER_CORE_MODULE(river, river);
|
||||
#endif
|
||||
REGISTER_CORE_MODULE(sway-xkb, sway_xkb);
|
||||
REGISTER_CORE_MODULE(script, script);
|
||||
#if defined(HAVE_PLUGIN_xkb)
|
||||
REGISTER_CORE_MODULE(xkb, xkb);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue