mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
meson: make ‘cpu’ plugin compile time optional
This commit is contained in:
parent
25e123fbe6
commit
b23365ccac
4 changed files with 15 additions and 3 deletions
|
@ -136,6 +136,7 @@ yambar = executable(
|
||||||
plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [],
|
plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [],
|
||||||
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_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' : [],
|
||||||
|
@ -182,6 +183,7 @@ summary(
|
||||||
'Backlight': plugin_backlight_enabled,
|
'Backlight': plugin_backlight_enabled,
|
||||||
'Battery': plugin_battery_enabled,
|
'Battery': plugin_battery_enabled,
|
||||||
'Clock': plugin_clock_enabled,
|
'Clock': plugin_clock_enabled,
|
||||||
|
'CPU': plugin_cpu_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,
|
||||||
|
|
|
@ -14,6 +14,8 @@ option('plugin-battery', type: 'feature', value: 'auto',
|
||||||
description: 'Battery support')
|
description: 'Battery support')
|
||||||
option('plugin-clock', type: 'feature', value: 'auto',
|
option('plugin-clock', type: 'feature', value: 'auto',
|
||||||
description: 'Clock support')
|
description: 'Clock support')
|
||||||
|
option('plugin-cpu', type: 'feature', value: 'auto',
|
||||||
|
description: 'CPU 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',
|
||||||
|
|
|
@ -17,6 +17,7 @@ udev_battery = dependency('libudev', required: get_option('plugin-battery'))
|
||||||
plugin_battery_enabled = udev_battery.found()
|
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()
|
||||||
|
|
||||||
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()
|
||||||
|
@ -31,7 +32,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 = {
|
||||||
'cpu': [[], []],
|
|
||||||
'disk-io': [[], [dynlist]],
|
'disk-io': [[], [dynlist]],
|
||||||
'mem': [[], []],
|
'mem': [[], []],
|
||||||
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||||
|
@ -58,6 +58,10 @@ if plugin_clock_enabled
|
||||||
mod_data += {'clock': [[], []]}
|
mod_data += {'clock': [[], []]}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if plugin_cpu_enabled
|
||||||
|
mod_data += {'cpu': [[], []]}
|
||||||
|
endif
|
||||||
|
|
||||||
if plugin_dwl_enabled
|
if plugin_dwl_enabled
|
||||||
mod_data += {'dwl': [[], [dynlist]]}
|
mod_data += {'dwl': [[], [dynlist]]}
|
||||||
endif
|
endif
|
||||||
|
|
8
plugin.c
8
plugin.c
|
@ -44,6 +44,9 @@ EXTERN_MODULE(battery);
|
||||||
#if defined(PLUGIN_ENABLED_CLOCK)
|
#if defined(PLUGIN_ENABLED_CLOCK)
|
||||||
EXTERN_MODULE(clock);
|
EXTERN_MODULE(clock);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_CPU)
|
||||||
|
EXTERN_MODULE(cpu);
|
||||||
|
#endif
|
||||||
EXTERN_MODULE(disk_io);
|
EXTERN_MODULE(disk_io);
|
||||||
#if defined(PLUGIN_ENABLED_DWL)
|
#if defined(PLUGIN_ENABLED_DWL)
|
||||||
EXTERN_MODULE(dwl);
|
EXTERN_MODULE(dwl);
|
||||||
|
@ -67,7 +70,6 @@ EXTERN_MODULE(sway_xkb);
|
||||||
EXTERN_MODULE(script);
|
EXTERN_MODULE(script);
|
||||||
EXTERN_MODULE(xkb);
|
EXTERN_MODULE(xkb);
|
||||||
EXTERN_MODULE(xwindow);
|
EXTERN_MODULE(xwindow);
|
||||||
EXTERN_MODULE(cpu);
|
|
||||||
EXTERN_MODULE(mem);
|
EXTERN_MODULE(mem);
|
||||||
|
|
||||||
EXTERN_PARTICLE(empty);
|
EXTERN_PARTICLE(empty);
|
||||||
|
@ -143,6 +145,9 @@ init(void)
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_CLOCK)
|
#if defined(PLUGIN_ENABLED_CLOCK)
|
||||||
REGISTER_CORE_MODULE(clock, clock);
|
REGISTER_CORE_MODULE(clock, clock);
|
||||||
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_CPU)
|
||||||
|
REGISTER_CORE_MODULE(cpu, cpu);
|
||||||
#endif
|
#endif
|
||||||
REGISTER_CORE_MODULE(disk-io, disk_io);
|
REGISTER_CORE_MODULE(disk-io, disk_io);
|
||||||
#if defined(PLUGIN_ENABLED_DWL)
|
#if defined(PLUGIN_ENABLED_DWL)
|
||||||
|
@ -176,7 +181,6 @@ init(void)
|
||||||
REGISTER_CORE_MODULE(xwindow, xwindow);
|
REGISTER_CORE_MODULE(xwindow, xwindow);
|
||||||
#endif
|
#endif
|
||||||
REGISTER_CORE_MODULE(mem, mem);
|
REGISTER_CORE_MODULE(mem, mem);
|
||||||
REGISTER_CORE_MODULE(cpu, cpu);
|
|
||||||
|
|
||||||
REGISTER_CORE_PARTICLE(empty, empty);
|
REGISTER_CORE_PARTICLE(empty, empty);
|
||||||
REGISTER_CORE_PARTICLE(list, list);
|
REGISTER_CORE_PARTICLE(list, list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue