forked from external/yambar
meson: make ‘disk-io’ plugin compile time optional
This commit is contained in:
parent
b23365ccac
commit
659b282445
4 changed files with 13 additions and 1 deletions
|
@ -137,6 +137,7 @@ yambar = executable(
|
||||||
plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [],
|
plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [],
|
||||||
plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [],
|
plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [],
|
||||||
plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [],
|
plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [],
|
||||||
|
plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [],
|
||||||
plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [],
|
plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [],
|
||||||
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [],
|
||||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||||
|
@ -184,6 +185,7 @@ summary(
|
||||||
'Battery': plugin_battery_enabled,
|
'Battery': plugin_battery_enabled,
|
||||||
'Clock': plugin_clock_enabled,
|
'Clock': plugin_clock_enabled,
|
||||||
'CPU': plugin_cpu_enabled,
|
'CPU': plugin_cpu_enabled,
|
||||||
|
'Disk I/O': plugin_disk_io_enabled,
|
||||||
'DWL (dwm for Wayland)': plugin_dwl_enabled,
|
'DWL (dwm for Wayland)': plugin_dwl_enabled,
|
||||||
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
'Music Player Daemon (MPD)': plugin_mpd_enabled,
|
||||||
'Pipewire': plugin_pipewire_enabled,
|
'Pipewire': plugin_pipewire_enabled,
|
||||||
|
|
|
@ -16,6 +16,8 @@ option('plugin-clock', type: 'feature', value: 'auto',
|
||||||
description: 'Clock support')
|
description: 'Clock support')
|
||||||
option('plugin-cpu', type: 'feature', value: 'auto',
|
option('plugin-cpu', type: 'feature', value: 'auto',
|
||||||
description: 'CPU support')
|
description: 'CPU support')
|
||||||
|
option('plugin-disk-io', type: 'feature', value: 'auto',
|
||||||
|
description: 'Disk I/O support')
|
||||||
option('plugin-dwl', type: 'feature', value: 'auto',
|
option('plugin-dwl', type: 'feature', value: 'auto',
|
||||||
description: 'DWL (dwm for wayland) support')
|
description: 'DWL (dwm for wayland) support')
|
||||||
option('plugin-mpd', type: 'feature', value: 'auto',
|
option('plugin-mpd', type: 'feature', value: 'auto',
|
||||||
|
|
|
@ -18,6 +18,7 @@ plugin_battery_enabled = udev_battery.found()
|
||||||
|
|
||||||
plugin_clock_enabled = get_option('plugin-clock').allowed()
|
plugin_clock_enabled = get_option('plugin-clock').allowed()
|
||||||
plugin_cpu_enabled = get_option('plugin-cpu').allowed()
|
plugin_cpu_enabled = get_option('plugin-cpu').allowed()
|
||||||
|
plugin_disk_io_enabled = get_option('plugin-disk-io').allowed()
|
||||||
|
|
||||||
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
|
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
|
||||||
plugin_mpd_enabled = mpd.found()
|
plugin_mpd_enabled = mpd.found()
|
||||||
|
@ -32,7 +33,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
||||||
|
|
||||||
# Module name -> (source-list, dep-list)
|
# Module name -> (source-list, dep-list)
|
||||||
mod_data = {
|
mod_data = {
|
||||||
'disk-io': [[], [dynlist]],
|
|
||||||
'mem': [[], []],
|
'mem': [[], []],
|
||||||
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||||
'label': [[], []],
|
'label': [[], []],
|
||||||
|
@ -62,6 +62,10 @@ if plugin_cpu_enabled
|
||||||
mod_data += {'cpu': [[], []]}
|
mod_data += {'cpu': [[], []]}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if plugin_disk_io_enabled
|
||||||
|
mod_data += {'disk-io': [[], [dynlist]]}
|
||||||
|
endif
|
||||||
|
|
||||||
if plugin_dwl_enabled
|
if plugin_dwl_enabled
|
||||||
mod_data += {'dwl': [[], [dynlist]]}
|
mod_data += {'dwl': [[], [dynlist]]}
|
||||||
endif
|
endif
|
||||||
|
|
4
plugin.c
4
plugin.c
|
@ -47,7 +47,9 @@ EXTERN_MODULE(clock);
|
||||||
#if defined(PLUGIN_ENABLED_CPU)
|
#if defined(PLUGIN_ENABLED_CPU)
|
||||||
EXTERN_MODULE(cpu);
|
EXTERN_MODULE(cpu);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_DISK_IO)
|
||||||
EXTERN_MODULE(disk_io);
|
EXTERN_MODULE(disk_io);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_DWL)
|
#if defined(PLUGIN_ENABLED_DWL)
|
||||||
EXTERN_MODULE(dwl);
|
EXTERN_MODULE(dwl);
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,7 +151,9 @@ init(void)
|
||||||
#if defined(PLUGIN_ENABLED_CPU)
|
#if defined(PLUGIN_ENABLED_CPU)
|
||||||
REGISTER_CORE_MODULE(cpu, cpu);
|
REGISTER_CORE_MODULE(cpu, cpu);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_DISK_IO)
|
||||||
REGISTER_CORE_MODULE(disk-io, disk_io);
|
REGISTER_CORE_MODULE(disk-io, disk_io);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_DWL)
|
#if defined(PLUGIN_ENABLED_DWL)
|
||||||
REGISTER_CORE_MODULE(dwl, dwl);
|
REGISTER_CORE_MODULE(dwl, dwl);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue