From f8f0d7ae99d020ebb42022691263149a536e0c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 13 Dec 2022 16:36:55 +0100 Subject: [PATCH 01/25] meson_options: sort plugin options --- meson_options.txt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index bd77f77..4290696 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,15 +5,12 @@ option( option( 'core-plugins-as-shared-libraries', type: 'boolean', value: false, description: 'Compiles modules, particles and decorations as shared libraries, which are loaded on-demand') -option( - 'plugin-mpd', type: 'feature', value: 'auto', - description: 'Music Player Daemon (MPD) support') -option( - 'plugin-pulse', type: 'feature', value: 'auto', - description: 'PulseAudio support') -option( - 'plugin-pipewire', type: 'feature', value: 'auto', - description: 'Pipewire support') -option( - 'plugin-dwl', type: 'feature', value: 'auto', - description: 'DWL (dwm for wayland) support') + +option('plugin-dwl', type: 'feature', value: 'auto', + description: 'DWL (dwm for wayland) support') +option('plugin-mpd', type: 'feature', value: 'auto', + description: 'Music Player Daemon (MPD) support') +option('plugin-pipewire', type: 'feature', value: 'auto', + description: 'Pipewire support') +option('plugin-pulse', type: 'feature', value: 'auto', + description: 'PulseAudio support') From 4c1398f1a57c6f7beb43bd99def1bfdeef0c82d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 13 Dec 2022 16:40:49 +0100 Subject: [PATCH 02/25] =?UTF-8?q?meson:=20make=20=E2=80=98alsa=E2=80=99=20?= =?UTF-8?q?plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 10 ++++++---- meson_options.txt | 1 + modules/meson.build | 10 ++++++++-- plugin.c | 4 ++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index a26f682..f176467 100644 --- a/meson.build +++ b/meson.build @@ -132,10 +132,11 @@ yambar = executable( dependencies: [bar, libepoll, libinotify, pixman, yaml, threads, dl, tllist, fcft] + decorations + particles + modules, c_args: [ - plugin_mpd_enabled? '-DPLUGIN_ENABLED_MPD':[], - plugin_pulse_enabled? '-DPLUGIN_ENABLED_PULSE':[], - plugin_pipewire_enabled? '-DPLUGIN_ENABLED_PIPEWIRE':[], - plugin_dwl_enabled? '-DPLUGIN_ENABLED_DWL':[], + plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [], + plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], + plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], + plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], + plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, @@ -174,6 +175,7 @@ summary( summary( { + 'ALSA': plugin_alsa_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/meson_options.txt b/meson_options.txt index 4290696..fd0718f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,7 @@ option( 'core-plugins-as-shared-libraries', type: 'boolean', value: false, description: 'Compiles modules, particles and decorations as shared libraries, which are loaded on-demand') +option('plugin-alsa', type: 'feature', value: 'auto', description: 'ALSA') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') option('plugin-mpd', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 56a4757..4adc705 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -2,14 +2,17 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft]) modules = [] -alsa = dependency('alsa') udev = dependency('libudev') json = dependency('json-c') xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) # Optional deps +alsa = dependency('alsa', required: get_option('plugin-alsa')) +plugin_alsa_enabled = alsa.found() + mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() + pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire')) plugin_pipewire_enabled = pipewire.found() @@ -20,7 +23,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'alsa': [[], [m, alsa]], 'backlight': [[], [m, udev]], 'battery': [[], [udev]], 'clock': [[], []], @@ -35,6 +37,10 @@ mod_data = { 'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]], } +if plugin_alsa_enabled + mod_data += {'alsa': [[], [m, alsa]]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index 6320434..a83dbad 100644 --- a/plugin.c +++ b/plugin.c @@ -32,7 +32,9 @@ keychain_t *chain, const struct yml_node *node); \ extern struct deco *plug_name##_from_conf(const struct yml_node *node); +#if defined(PLUGIN_ENABLED_ALSA) EXTERN_MODULE(alsa); +#endif EXTERN_MODULE(backlight); EXTERN_MODULE(battery); EXTERN_MODULE(clock); @@ -124,7 +126,9 @@ init(void) tll_back(plugins).decoration = &deco_##func_prefix##_iface; \ } while (0) +#if defined(PLUGIN_ENABLED_ALSA) REGISTER_CORE_MODULE(alsa, alsa); +#endif REGISTER_CORE_MODULE(backlight, backlight); REGISTER_CORE_MODULE(battery, battery); REGISTER_CORE_MODULE(clock, clock); From 881359183f163046ccc3c9dd4ded63a11e030e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 13 Dec 2022 16:47:48 +0100 Subject: [PATCH 03/25] =?UTF-8?q?meson:=20make=20=E2=80=98backlight?= =?UTF-8?q?=E2=80=99=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 7 ++++++- modules/meson.build | 10 ++++++++-- plugin.c | 4 ++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index f176467..102cbc0 100644 --- a/meson.build +++ b/meson.build @@ -133,6 +133,7 @@ yambar = executable( decorations + particles + modules, c_args: [ plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [], + plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], @@ -176,6 +177,7 @@ summary( summary( { 'ALSA': plugin_alsa_enabled, + 'Backlight': plugin_backlight_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/meson_options.txt b/meson_options.txt index fd0718f..ab8837f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,7 +6,12 @@ option( 'core-plugins-as-shared-libraries', type: 'boolean', value: false, description: 'Compiles modules, particles and decorations as shared libraries, which are loaded on-demand') -option('plugin-alsa', type: 'feature', value: 'auto', description: 'ALSA') +option('plugin-alsa', type: 'feature', value: 'auto', + description: 'ALSA support') +option('plugin-backlight', type: 'feature', value: 'auto', + description: 'Backlight support') +option('plugin-battery', type: 'feature', value: 'auto', + description: 'Battery support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') option('plugin-mpd', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 4adc705..e4b7027 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -2,7 +2,7 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft]) modules = [] -udev = dependency('libudev') +udev = dependency('udev') json = dependency('json-c') xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) @@ -10,6 +10,9 @@ xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) alsa = dependency('alsa', required: get_option('plugin-alsa')) plugin_alsa_enabled = alsa.found() +udev_backlight = dependency('libudev', required: get_option('plugin-backlight')) +plugin_backlight_enabled = udev_backlight.found() + mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() @@ -23,7 +26,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'backlight': [[], [m, udev]], 'battery': [[], [udev]], 'clock': [[], []], 'cpu': [[], []], @@ -41,6 +43,10 @@ if plugin_alsa_enabled mod_data += {'alsa': [[], [m, alsa]]} endif +if plugin_backlight_enabled + mod_data += {'backlight': [[], [m, udev_backlight]]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index a83dbad..8421176 100644 --- a/plugin.c +++ b/plugin.c @@ -35,7 +35,9 @@ #if defined(PLUGIN_ENABLED_ALSA) EXTERN_MODULE(alsa); #endif +#if defined(PLUGIN_ENABLED_BACKLIGHT) EXTERN_MODULE(backlight); +#endif EXTERN_MODULE(battery); EXTERN_MODULE(clock); EXTERN_MODULE(disk_io); @@ -129,7 +131,9 @@ init(void) #if defined(PLUGIN_ENABLED_ALSA) REGISTER_CORE_MODULE(alsa, alsa); #endif +#if defined(PLUGIN_ENABLED_BACKLIGHT) REGISTER_CORE_MODULE(backlight, backlight); +#endif REGISTER_CORE_MODULE(battery, battery); REGISTER_CORE_MODULE(clock, clock); REGISTER_CORE_MODULE(disk-io, disk_io); From aeef3eca0ece4994169f1fac34533133f56ca29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 13 Dec 2022 16:49:37 +0100 Subject: [PATCH 04/25] =?UTF-8?q?meson:=20make=20=E2=80=98battery=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ modules/meson.build | 8 +++++++- plugin.c | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 102cbc0..9d2128a 100644 --- a/meson.build +++ b/meson.build @@ -134,6 +134,7 @@ yambar = executable( c_args: [ plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [], plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [], + plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], @@ -178,6 +179,7 @@ summary( { 'ALSA': plugin_alsa_enabled, 'Backlight': plugin_backlight_enabled, + 'Battery': plugin_battery_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/modules/meson.build b/modules/meson.build index e4b7027..4252364 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -13,6 +13,9 @@ plugin_alsa_enabled = alsa.found() udev_backlight = dependency('libudev', required: get_option('plugin-backlight')) plugin_backlight_enabled = udev_backlight.found() +udev_battery = dependency('libudev', required: get_option('plugin-battery')) +plugin_battery_enabled = udev_battery.found() + mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() @@ -26,7 +29,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'battery': [[], [udev]], 'clock': [[], []], 'cpu': [[], []], 'disk-io': [[], [dynlist]], @@ -47,6 +49,10 @@ if plugin_backlight_enabled mod_data += {'backlight': [[], [m, udev_backlight]]} endif +if plugin_battery_enabled + mod_data += {'battery': [[], [udev_battery]]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index 8421176..6f7e5cc 100644 --- a/plugin.c +++ b/plugin.c @@ -38,7 +38,9 @@ EXTERN_MODULE(alsa); #if defined(PLUGIN_ENABLED_BACKLIGHT) EXTERN_MODULE(backlight); #endif +#if defined(PLUGIN_ENABLED_BATTERY) EXTERN_MODULE(battery); +#endif EXTERN_MODULE(clock); EXTERN_MODULE(disk_io); #if defined(PLUGIN_ENABLED_DWL) @@ -134,7 +136,9 @@ init(void) #if defined(PLUGIN_ENABLED_BACKLIGHT) REGISTER_CORE_MODULE(backlight, backlight); #endif +#if defined(PLUGIN_ENABLED_BATTERY) REGISTER_CORE_MODULE(battery, battery); +#endif REGISTER_CORE_MODULE(clock, clock); REGISTER_CORE_MODULE(disk-io, disk_io); #if defined(PLUGIN_ENABLED_DWL) From 25e123fbe66ad6b2404bd3be7dd75a1cc6f47743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:28:42 +0100 Subject: [PATCH 05/25] =?UTF-8?q?meson:=20make=20=E2=80=98clock=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 7 ++++++- plugin.c | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9d2128a..7b4bf40 100644 --- a/meson.build +++ b/meson.build @@ -135,6 +135,7 @@ yambar = executable( plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [], plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [], plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [], + plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], @@ -180,6 +181,7 @@ summary( 'ALSA': plugin_alsa_enabled, 'Backlight': plugin_backlight_enabled, 'Battery': plugin_battery_enabled, + 'Clock': plugin_clock_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/meson_options.txt b/meson_options.txt index ab8837f..cce0d08 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,6 +12,8 @@ option('plugin-backlight', type: 'feature', value: 'auto', description: 'Backlight support') option('plugin-battery', type: 'feature', value: 'auto', description: 'Battery support') +option('plugin-clock', type: 'feature', value: 'auto', + description: 'Clock support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') option('plugin-mpd', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 4252364..4a06e43 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -16,6 +16,8 @@ plugin_backlight_enabled = udev_backlight.found() udev_battery = dependency('libudev', required: get_option('plugin-battery')) plugin_battery_enabled = udev_battery.found() +plugin_clock_enabled = get_option('plugin-clock').allowed() + mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() @@ -29,7 +31,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'clock': [[], []], 'cpu': [[], []], 'disk-io': [[], [dynlist]], 'mem': [[], []], @@ -53,6 +54,10 @@ if plugin_battery_enabled mod_data += {'battery': [[], [udev_battery]]} endif +if plugin_clock_enabled + mod_data += {'clock': [[], []]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index 6f7e5cc..10acb3f 100644 --- a/plugin.c +++ b/plugin.c @@ -41,7 +41,9 @@ EXTERN_MODULE(backlight); #if defined(PLUGIN_ENABLED_BATTERY) EXTERN_MODULE(battery); #endif +#if defined(PLUGIN_ENABLED_CLOCK) EXTERN_MODULE(clock); +#endif EXTERN_MODULE(disk_io); #if defined(PLUGIN_ENABLED_DWL) EXTERN_MODULE(dwl); @@ -139,7 +141,9 @@ init(void) #if defined(PLUGIN_ENABLED_BATTERY) REGISTER_CORE_MODULE(battery, battery); #endif +#if defined(PLUGIN_ENABLED_CLOCK) REGISTER_CORE_MODULE(clock, clock); +#endif REGISTER_CORE_MODULE(disk-io, disk_io); #if defined(PLUGIN_ENABLED_DWL) REGISTER_CORE_MODULE(dwl, dwl); From b23365ccacd25911a35a31d8b6b869512520f1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:31:48 +0100 Subject: [PATCH 06/25] =?UTF-8?q?meson:=20make=20=E2=80=98cpu=E2=80=99=20p?= =?UTF-8?q?lugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 6 +++++- plugin.c | 8 ++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7b4bf40..223d3c7 100644 --- a/meson.build +++ b/meson.build @@ -136,6 +136,7 @@ yambar = executable( plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [], plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [], plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [], + plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], @@ -182,6 +183,7 @@ summary( 'Backlight': plugin_backlight_enabled, 'Battery': plugin_battery_enabled, 'Clock': plugin_clock_enabled, + 'CPU': plugin_cpu_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/meson_options.txt b/meson_options.txt index cce0d08..ca92b74 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,6 +14,8 @@ option('plugin-battery', type: 'feature', value: 'auto', description: 'Battery support') option('plugin-clock', type: 'feature', value: 'auto', description: 'Clock support') +option('plugin-cpu', type: 'feature', value: 'auto', + description: 'CPU support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') option('plugin-mpd', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 4a06e43..a061e01 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -17,6 +17,7 @@ udev_battery = dependency('libudev', required: get_option('plugin-battery')) plugin_battery_enabled = udev_battery.found() plugin_clock_enabled = get_option('plugin-clock').allowed() +plugin_cpu_enabled = get_option('plugin-cpu').allowed() mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() @@ -31,7 +32,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'cpu': [[], []], 'disk-io': [[], [dynlist]], 'mem': [[], []], 'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]], @@ -58,6 +58,10 @@ if plugin_clock_enabled mod_data += {'clock': [[], []]} endif +if plugin_cpu_enabled + mod_data += {'cpu': [[], []]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index 10acb3f..c54a97f 100644 --- a/plugin.c +++ b/plugin.c @@ -44,6 +44,9 @@ EXTERN_MODULE(battery); #if defined(PLUGIN_ENABLED_CLOCK) EXTERN_MODULE(clock); #endif +#if defined(PLUGIN_ENABLED_CPU) +EXTERN_MODULE(cpu); +#endif EXTERN_MODULE(disk_io); #if defined(PLUGIN_ENABLED_DWL) EXTERN_MODULE(dwl); @@ -67,7 +70,6 @@ EXTERN_MODULE(sway_xkb); EXTERN_MODULE(script); EXTERN_MODULE(xkb); EXTERN_MODULE(xwindow); -EXTERN_MODULE(cpu); EXTERN_MODULE(mem); EXTERN_PARTICLE(empty); @@ -143,6 +145,9 @@ init(void) #endif #if defined(PLUGIN_ENABLED_CLOCK) REGISTER_CORE_MODULE(clock, clock); +#endif +#if defined(PLUGIN_ENABLED_CPU) + REGISTER_CORE_MODULE(cpu, cpu); #endif REGISTER_CORE_MODULE(disk-io, disk_io); #if defined(PLUGIN_ENABLED_DWL) @@ -176,7 +181,6 @@ init(void) REGISTER_CORE_MODULE(xwindow, xwindow); #endif REGISTER_CORE_MODULE(mem, mem); - REGISTER_CORE_MODULE(cpu, cpu); REGISTER_CORE_PARTICLE(empty, empty); REGISTER_CORE_PARTICLE(list, list); From 659b2824458931dd311eaf7aa2258def1c397a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:34:05 +0100 Subject: [PATCH 07/25] =?UTF-8?q?meson:=20make=20=E2=80=98disk-io=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 6 +++++- plugin.c | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 223d3c7..ebcec99 100644 --- a/meson.build +++ b/meson.build @@ -137,6 +137,7 @@ yambar = executable( plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [], plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [], plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [], + plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], @@ -184,6 +185,7 @@ summary( 'Battery': plugin_battery_enabled, 'Clock': plugin_clock_enabled, 'CPU': plugin_cpu_enabled, + 'Disk I/O': plugin_disk_io_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, diff --git a/meson_options.txt b/meson_options.txt index ca92b74..ad1f130 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,6 +16,8 @@ option('plugin-clock', type: 'feature', value: 'auto', description: 'Clock support') option('plugin-cpu', type: 'feature', value: 'auto', description: 'CPU support') +option('plugin-disk-io', type: 'feature', value: 'auto', + description: 'Disk I/O support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') option('plugin-mpd', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index a061e01..aedc343 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -18,6 +18,7 @@ plugin_battery_enabled = udev_battery.found() plugin_clock_enabled = get_option('plugin-clock').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')) plugin_mpd_enabled = mpd.found() @@ -32,7 +33,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'disk-io': [[], [dynlist]], 'mem': [[], []], 'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]], 'label': [[], []], @@ -62,6 +62,10 @@ if plugin_cpu_enabled mod_data += {'cpu': [[], []]} endif +if plugin_disk_io_enabled + mod_data += {'disk-io': [[], [dynlist]]} +endif + if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif diff --git a/plugin.c b/plugin.c index c54a97f..0828e7e 100644 --- a/plugin.c +++ b/plugin.c @@ -47,7 +47,9 @@ EXTERN_MODULE(clock); #if defined(PLUGIN_ENABLED_CPU) EXTERN_MODULE(cpu); #endif +#if defined(PLUGIN_ENABLED_DISK_IO) EXTERN_MODULE(disk_io); +#endif #if defined(PLUGIN_ENABLED_DWL) EXTERN_MODULE(dwl); #endif @@ -149,7 +151,9 @@ init(void) #if defined(PLUGIN_ENABLED_CPU) REGISTER_CORE_MODULE(cpu, cpu); #endif +#if defined(PLUGIN_ENABLED_DISK_IO) REGISTER_CORE_MODULE(disk-io, disk_io); +#endif #if defined(PLUGIN_ENABLED_DWL) REGISTER_CORE_MODULE(dwl, dwl); #endif From 85d55905f98f8586c1051c1c70b5e080d3d8e6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:36:34 +0100 Subject: [PATCH 08/25] =?UTF-8?q?meson:=20make=20=E2=80=98mem=E2=80=99=20p?= =?UTF-8?q?lugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 6 ++++-- meson_options.txt | 4 +++- modules/meson.build | 6 +++++- plugin.c | 8 ++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index ebcec99..6bf4e21 100644 --- a/meson.build +++ b/meson.build @@ -139,6 +139,7 @@ yambar = executable( plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [], plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], + plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], @@ -184,9 +185,10 @@ summary( 'Backlight': plugin_backlight_enabled, 'Battery': plugin_battery_enabled, 'Clock': plugin_clock_enabled, - 'CPU': plugin_cpu_enabled, - 'Disk I/O': plugin_disk_io_enabled, + 'CPU monitoring': plugin_cpu_enabled, + 'Disk I/O monitoring': plugin_disk_io_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, + 'Memory monitoring': plugin_mem_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'Pipewire': plugin_pipewire_enabled, 'PulseAudio': plugin_pulse_enabled, diff --git a/meson_options.txt b/meson_options.txt index ad1f130..4c287ab 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,11 +15,13 @@ option('plugin-battery', type: 'feature', value: 'auto', option('plugin-clock', type: 'feature', value: 'auto', description: 'Clock support') option('plugin-cpu', type: 'feature', value: 'auto', - description: 'CPU support') + description: 'CPU monitoring support') option('plugin-disk-io', type: 'feature', value: 'auto', description: 'Disk I/O support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') +option('plugin-mem', type: 'feature', value: 'auto', + description: 'Memory monitoring support') option('plugin-mpd', type: 'feature', value: 'auto', description: 'Music Player Daemon (MPD) support') option('plugin-pipewire', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index aedc343..c9d4aa3 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -19,6 +19,7 @@ plugin_battery_enabled = udev_battery.found() plugin_clock_enabled = get_option('plugin-clock').allowed() plugin_cpu_enabled = get_option('plugin-cpu').allowed() plugin_disk_io_enabled = get_option('plugin-disk-io').allowed() +plugin_mem_enabled = get_option('plugin-mem').allowed() mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() @@ -33,7 +34,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'mem': [[], []], 'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]], 'label': [[], []], 'network': [[], []], @@ -70,6 +70,10 @@ if plugin_dwl_enabled mod_data += {'dwl': [[], [dynlist]]} endif +if plugin_mem_enabled + mod_data += {'mem': [[], []]} +endif + if plugin_mpd_enabled mod_data += {'mpd': [[], [mpd]]} endif diff --git a/plugin.c b/plugin.c index 0828e7e..f61a334 100644 --- a/plugin.c +++ b/plugin.c @@ -56,6 +56,9 @@ EXTERN_MODULE(dwl); EXTERN_MODULE(foreign_toplevel); EXTERN_MODULE(i3); EXTERN_MODULE(label); +#if defined(PLUGIN_ENABLED_MEM) +EXTERN_MODULE(mem); +#endif #if defined(PLUGIN_ENABLED_MPD) EXTERN_MODULE(mpd); #endif @@ -72,7 +75,6 @@ EXTERN_MODULE(sway_xkb); EXTERN_MODULE(script); EXTERN_MODULE(xkb); EXTERN_MODULE(xwindow); -EXTERN_MODULE(mem); EXTERN_PARTICLE(empty); EXTERN_PARTICLE(list); @@ -162,6 +164,9 @@ init(void) #endif REGISTER_CORE_MODULE(i3, i3); REGISTER_CORE_MODULE(label, label); +#if defined(PLUGIN_ENABLED_MEM) + REGISTER_CORE_MODULE(mem, mem); +#endif #if defined(PLUGIN_ENABLED_MPD) REGISTER_CORE_MODULE(mpd, mpd); #endif @@ -184,7 +189,6 @@ init(void) #if defined(HAVE_PLUGIN_xwindow) REGISTER_CORE_MODULE(xwindow, xwindow); #endif - REGISTER_CORE_MODULE(mem, mem); REGISTER_CORE_PARTICLE(empty, empty); REGISTER_CORE_PARTICLE(list, list); From f54f583be176f01f33cc5f2189da8f37a5338d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:39:47 +0100 Subject: [PATCH 09/25] =?UTF-8?q?meson:=20make=20=E2=80=98i3=E2=80=99=20pl?= =?UTF-8?q?ugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 9 ++++++++- plugin.c | 8 ++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 6bf4e21..fb71480 100644 --- a/meson.build +++ b/meson.build @@ -141,6 +141,7 @@ yambar = executable( plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], + plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], ], @@ -190,6 +191,7 @@ summary( 'DWL (dwm for Wayland)': plugin_dwl_enabled, 'Memory monitoring': plugin_mem_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, + 'i3+Sway': plugin_i3_enabled, 'Pipewire': plugin_pipewire_enabled, 'PulseAudio': plugin_pulse_enabled, }, diff --git a/meson_options.txt b/meson_options.txt index 4c287ab..abe233a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,6 +24,8 @@ option('plugin-mem', type: 'feature', value: 'auto', description: 'Memory monitoring support') option('plugin-mpd', type: 'feature', value: 'auto', description: 'Music Player Daemon (MPD) support') +option('plugin-i3', type: 'feature', value: 'auto', + description: 'i3+Sway support') option('plugin-pipewire', type: 'feature', value: 'auto', description: 'Pipewire support') option('plugin-pulse', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index c9d4aa3..91babbb 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -24,6 +24,9 @@ plugin_mem_enabled = get_option('plugin-mem').allowed() mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) plugin_mpd_enabled = mpd.found() +json_i3 = dependency('json-c', required: get_option('plugin-i3')) +plugin_i3_enabled = json_i3.found() + pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire')) plugin_pipewire_enabled = pipewire.found() @@ -34,7 +37,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json]], 'label': [[], []], 'network': [[], []], 'removables': [[], [dynlist, udev]], @@ -77,6 +79,11 @@ endif if plugin_mpd_enabled mod_data += {'mpd': [[], [mpd]]} endif + +if plugin_i3_enabled + mod_data += {'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json_i3]]} +endif + if plugin_pipewire_enabled mod_data += {'pipewire': [[], [pipewire, dynlist, json]]} endif diff --git a/plugin.c b/plugin.c index f61a334..eda9cf2 100644 --- a/plugin.c +++ b/plugin.c @@ -54,7 +54,6 @@ EXTERN_MODULE(disk_io); EXTERN_MODULE(dwl); #endif EXTERN_MODULE(foreign_toplevel); -EXTERN_MODULE(i3); EXTERN_MODULE(label); #if defined(PLUGIN_ENABLED_MEM) EXTERN_MODULE(mem); @@ -62,6 +61,9 @@ EXTERN_MODULE(mem); #if defined(PLUGIN_ENABLED_MPD) EXTERN_MODULE(mpd); #endif +#if defined(PLUGIN_ENABLED_I3) +EXTERN_MODULE(i3); +#endif EXTERN_MODULE(network); #if defined(PLUGIN_ENABLED_PULSE) EXTERN_MODULE(pulse); @@ -162,13 +164,15 @@ init(void) #if defined(HAVE_PLUGIN_foreign_toplevel) REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel); #endif - REGISTER_CORE_MODULE(i3, i3); REGISTER_CORE_MODULE(label, label); #if defined(PLUGIN_ENABLED_MEM) REGISTER_CORE_MODULE(mem, mem); #endif #if defined(PLUGIN_ENABLED_MPD) REGISTER_CORE_MODULE(mpd, mpd); +#endif +#if defined(PLUGIN_ENABLED_I3) + REGISTER_CORE_MODULE(i3, i3); #endif REGISTER_CORE_MODULE(network, network); #if defined(PLUGIN_ENABLED_PULSE) From 8d5e8b5f205469c1475059dd02bf80f5493060c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:41:44 +0100 Subject: [PATCH 10/25] =?UTF-8?q?meson:=20make=20=E2=80=98label=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 7 ++++++- plugin.c | 8 ++++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index fb71480..4a5c4d5 100644 --- a/meson.build +++ b/meson.build @@ -142,6 +142,7 @@ yambar = executable( plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [], + plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], ], @@ -192,6 +193,7 @@ summary( 'Memory monitoring': plugin_mem_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'i3+Sway': plugin_i3_enabled, + 'Label': plugin_label_enabled, 'Pipewire': plugin_pipewire_enabled, 'PulseAudio': plugin_pulse_enabled, }, diff --git a/meson_options.txt b/meson_options.txt index abe233a..c206f92 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,6 +26,8 @@ option('plugin-mpd', type: 'feature', value: 'auto', description: 'Music Player Daemon (MPD) support') option('plugin-i3', type: 'feature', value: 'auto', description: 'i3+Sway support') +option('plugin-label', type: 'feature', value: 'auto', + description: 'Label support') option('plugin-pipewire', type: 'feature', value: 'auto', description: 'Pipewire support') option('plugin-pulse', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 91babbb..6059970 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -27,6 +27,8 @@ plugin_mpd_enabled = mpd.found() json_i3 = dependency('json-c', required: get_option('plugin-i3')) plugin_i3_enabled = json_i3.found() +plugin_label_enabled = get_option('plugin-label').allowed() + pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire')) plugin_pipewire_enabled = pipewire.found() @@ -37,7 +39,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'label': [[], []], 'network': [[], []], 'removables': [[], [dynlist, udev]], 'script': [[], []], @@ -84,6 +85,10 @@ if plugin_i3_enabled mod_data += {'i3': [['i3-common.c', 'i3-common.h'], [dynlist, json_i3]]} endif +if plugin_label_enabled + mod_data += {'label': [[], []]} +endif + if plugin_pipewire_enabled mod_data += {'pipewire': [[], [pipewire, dynlist, json]]} endif diff --git a/plugin.c b/plugin.c index eda9cf2..9205df7 100644 --- a/plugin.c +++ b/plugin.c @@ -54,7 +54,6 @@ EXTERN_MODULE(disk_io); EXTERN_MODULE(dwl); #endif EXTERN_MODULE(foreign_toplevel); -EXTERN_MODULE(label); #if defined(PLUGIN_ENABLED_MEM) EXTERN_MODULE(mem); #endif @@ -64,6 +63,9 @@ EXTERN_MODULE(mpd); #if defined(PLUGIN_ENABLED_I3) EXTERN_MODULE(i3); #endif +#if defined(PLUGIN_ENABLED_LABEL) +EXTERN_MODULE(label); +#endif EXTERN_MODULE(network); #if defined(PLUGIN_ENABLED_PULSE) EXTERN_MODULE(pulse); @@ -164,7 +166,6 @@ init(void) #if defined(HAVE_PLUGIN_foreign_toplevel) REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel); #endif - REGISTER_CORE_MODULE(label, label); #if defined(PLUGIN_ENABLED_MEM) REGISTER_CORE_MODULE(mem, mem); #endif @@ -173,6 +174,9 @@ init(void) #endif #if defined(PLUGIN_ENABLED_I3) REGISTER_CORE_MODULE(i3, i3); +#endif +#if defined(PLUGIN_ENABLED_LABEL) + REGISTER_CORE_MODULE(label, label); #endif REGISTER_CORE_MODULE(network, network); #if defined(PLUGIN_ENABLED_PULSE) From b901ac50eedaac933304b92889f6ff92592efc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:43:14 +0100 Subject: [PATCH 11/25] =?UTF-8?q?meson:=20make=20=E2=80=98network=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 6 +++++- plugin.c | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4a5c4d5..0089fa7 100644 --- a/meson.build +++ b/meson.build @@ -143,6 +143,7 @@ yambar = executable( plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [], plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [], + plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [], plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], ], @@ -194,6 +195,7 @@ summary( 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'i3+Sway': plugin_i3_enabled, 'Label': plugin_label_enabled, + 'Network monitoring': plugin_network_enabled, 'Pipewire': plugin_pipewire_enabled, 'PulseAudio': plugin_pulse_enabled, }, diff --git a/meson_options.txt b/meson_options.txt index c206f92..d64f85b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,6 +28,8 @@ option('plugin-i3', type: 'feature', value: 'auto', description: 'i3+Sway support') option('plugin-label', type: 'feature', value: 'auto', description: 'Label support') +option('plugin-network', type: 'feature', value: 'auto', + description: 'Network monitoring support') option('plugin-pipewire', type: 'feature', value: 'auto', description: 'Pipewire support') option('plugin-pulse', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index 6059970..ba5647e 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -28,6 +28,7 @@ json_i3 = dependency('json-c', required: get_option('plugin-i3')) plugin_i3_enabled = json_i3.found() plugin_label_enabled = get_option('plugin-label').allowed() +plugin_network_enabled = get_option('plugin-network').allowed() pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire')) plugin_pipewire_enabled = pipewire.found() @@ -39,7 +40,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'network': [[], []], 'removables': [[], [dynlist, udev]], 'script': [[], []], 'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]], @@ -89,6 +89,10 @@ if plugin_label_enabled mod_data += {'label': [[], []]} endif +if plugin_network_enabled + mod_data += {'network': [[], []]} +endif + if plugin_pipewire_enabled mod_data += {'pipewire': [[], [pipewire, dynlist, json]]} endif diff --git a/plugin.c b/plugin.c index 9205df7..b08d5c5 100644 --- a/plugin.c +++ b/plugin.c @@ -66,7 +66,9 @@ EXTERN_MODULE(i3); #if defined(PLUGIN_ENABLED_LABEL) EXTERN_MODULE(label); #endif +#if defined(PLUGIN_ENABLED_NETWORK) EXTERN_MODULE(network); +#endif #if defined(PLUGIN_ENABLED_PULSE) EXTERN_MODULE(pulse); #endif @@ -178,7 +180,9 @@ init(void) #if defined(PLUGIN_ENABLED_LABEL) REGISTER_CORE_MODULE(label, label); #endif +#if defined(PLUGIN_ENABLED_NETWORK) REGISTER_CORE_MODULE(network, network); +#endif #if defined(PLUGIN_ENABLED_PULSE) REGISTER_CORE_MODULE(pulse, pulse); #endif From eb26f64ea73098913fd6bdc9218a06c5a0b53474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:46:08 +0100 Subject: [PATCH 12/25] =?UTF-8?q?meson:=20make=20=E2=80=98removables?= =?UTF-8?q?=E2=80=99=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 9 +++++++-- plugin.c | 8 ++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 0089fa7..09255a1 100644 --- a/meson.build +++ b/meson.build @@ -144,6 +144,7 @@ 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' : [], ], @@ -196,6 +197,7 @@ 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, }, diff --git a/meson_options.txt b/meson_options.txt index d64f85b..e130a0a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,6 +30,8 @@ option('plugin-label', type: 'feature', value: 'auto', description: 'Label support') 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-pipewire', type: 'feature', value: 'auto', description: 'Pipewire support') option('plugin-pulse', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index ba5647e..7eba966 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -2,7 +2,6 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft]) modules = [] -udev = dependency('udev') json = dependency('json-c') xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) @@ -30,6 +29,9 @@ plugin_i3_enabled = json_i3.found() plugin_label_enabled = get_option('plugin-label').allowed() plugin_network_enabled = get_option('plugin-network').allowed() +udev_removables = dependency('udev', required: get_option('plugin-removables')) +plugin_removables_enabled = udev_removables.found() + pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire')) plugin_pipewire_enabled = pipewire.found() @@ -40,7 +42,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed() # Module name -> (source-list, dep-list) mod_data = { - 'removables': [[], [dynlist, udev]], 'script': [[], []], 'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]], } @@ -93,6 +94,10 @@ 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 diff --git a/plugin.c b/plugin.c index b08d5c5..95fcff1 100644 --- a/plugin.c +++ b/plugin.c @@ -69,13 +69,15 @@ EXTERN_MODULE(label); #if defined(PLUGIN_ENABLED_NETWORK) EXTERN_MODULE(network); #endif +#if defined(PLUGIN_ENABLED_REMOVABLES) +EXTERN_MODULE(removables); +#endif #if defined(PLUGIN_ENABLED_PULSE) EXTERN_MODULE(pulse); #endif #if defined(PLUGIN_ENABLED_PIPEWIRE) EXTERN_MODULE(pipewire); #endif -EXTERN_MODULE(removables); EXTERN_MODULE(river); EXTERN_MODULE(sway_xkb); EXTERN_MODULE(script); @@ -183,13 +185,15 @@ init(void) #if defined(PLUGIN_ENABLED_NETWORK) REGISTER_CORE_MODULE(network, network); #endif +#if defined(PLUGIN_ENABLED_REMOVABLES) + REGISTER_CORE_MODULE(removables, removables); +#endif #if defined(PLUGIN_ENABLED_PULSE) REGISTER_CORE_MODULE(pulse, pulse); #endif #if defined(PLUGIN_ENABLED_PIPEWIRE) REGISTER_CORE_MODULE(pipewire, pipewire); #endif - REGISTER_CORE_MODULE(removables, removables); #if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif From ec9ed66b6b30520fbbc560902401b54947c6a716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:48:50 +0100 Subject: [PATCH 13/25] =?UTF-8?q?meson:=20make=20=E2=80=98script=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 6 ++++-- meson_options.txt | 2 ++ modules/meson.build | 15 ++++++++++----- plugin.c | 24 ++++++++++++++---------- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 09255a1..fd4eb67 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index e130a0a..918f207 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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', diff --git a/modules/meson.build b/modules/meson.build index 7eba966..279b050 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -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]], diff --git a/plugin.c b/plugin.c index 95fcff1..c6efc40 100644 --- a/plugin.c +++ b/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 From 0cf0d64970b2595b08ea09ed33f406bf30b89eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:50:22 +0100 Subject: [PATCH 14/25] =?UTF-8?q?meson:=20pipewire-specific=20=E2=80=98jso?= =?UTF-8?q?n=E2=80=99=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/meson.build | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/meson.build b/modules/meson.build index 279b050..5f34d00 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -18,6 +18,7 @@ plugin_battery_enabled = udev_battery.found() plugin_clock_enabled = get_option('plugin-clock').allowed() plugin_cpu_enabled = get_option('plugin-cpu').allowed() plugin_disk_io_enabled = get_option('plugin-disk-io').allowed() +plugin_dwl_enabled = get_option('plugin-dwl').allowed() plugin_mem_enabled = get_option('plugin-mem').allowed() mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) @@ -29,18 +30,17 @@ plugin_i3_enabled = json_i3.found() plugin_label_enabled = get_option('plugin-label').allowed() 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() +json_pipewire = dependency('json-c', required: get_option('plugin-pipewire')) +plugin_pipewire_enabled = pipewire.found() and json_pipewire.found() pulse = dependency('libpulse', required: get_option('plugin-pulse')) plugin_pulse_enabled = pulse.found() -plugin_dwl_enabled = get_option('plugin-dwl').allowed() +udev_removables = dependency('udev', required: get_option('plugin-removables')) +plugin_removables_enabled = udev_removables.found() + +plugin_script_enabled = get_option('plugin-script').allowed() # Module name -> (source-list, dep-list) mod_data = { @@ -96,7 +96,7 @@ if plugin_network_enabled endif if plugin_pipewire_enabled - mod_data += {'pipewire': [[], [pipewire, dynlist, json]]} + mod_data += {'pipewire': [[], [pipewire, dynlist, json_pipewire]]} endif if plugin_pulse_enabled From b6450446a8814c12160bf69a4d173d04b387189d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:53:24 +0100 Subject: [PATCH 15/25] =?UTF-8?q?meson:=20make=20=E2=80=98sway-xkb?= =?UTF-8?q?=E2=80=99=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 10 ++++++---- modules/meson.build | 12 ++++++++---- plugin.c | 8 ++++++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index fd4eb67..3223683 100644 --- a/meson.build +++ b/meson.build @@ -148,6 +148,7 @@ yambar = executable( plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [], plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], + plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, @@ -202,6 +203,7 @@ summary( 'PulseAudio': plugin_pulse_enabled, 'Removables monitoring': plugin_removables_enabled, 'Script': plugin_script_enabled, + 'Sway XKB keyboard': plugin_sway_xkb_enabled, }, section: 'Optional modules', bool_yn: true diff --git a/meson_options.txt b/meson_options.txt index 918f207..6c85875 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,11 +30,13 @@ option('plugin-label', type: 'feature', value: 'auto', description: 'Label support') 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', description: 'PulseAudio 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-sway-xkb', type: 'feature', value: 'auto', + description: 'keyboard support for Sway') diff --git a/modules/meson.build b/modules/meson.build index 5f34d00..9964b00 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -2,7 +2,6 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft]) modules = [] -json = dependency('json-c') xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) # Optional deps @@ -42,10 +41,11 @@ plugin_removables_enabled = udev_removables.found() plugin_script_enabled = get_option('plugin-script').allowed() +json_sway_xkb = dependency('json-c', required: get_option('plugin-sway-xkb')) +plugin_sway_xkb_enabled = json_sway_xkb.found() + # Module name -> (source-list, dep-list) -mod_data = { - 'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]], -} +mod_data = {} if plugin_alsa_enabled mod_data += {'alsa': [[], [m, alsa]]} @@ -111,6 +111,10 @@ if plugin_script_enabled mod_data += {'script': [[], []]} endif +if plugin_sway_xkb_enabled + mod_data += {'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json_sway_xkb]]} +endif + if backend_x11 mod_data += { 'xkb': [[], [xcb_stuff, xcb_xkb]], diff --git a/plugin.c b/plugin.c index c6efc40..79936cd 100644 --- a/plugin.c +++ b/plugin.c @@ -81,8 +81,10 @@ EXTERN_MODULE(removables); #if defined(PLUGIN_ENABLED_SCRIPT) EXTERN_MODULE(script); #endif -EXTERN_MODULE(river); +#if defined(PLUGIN_ENABLED_SWAY_XKB) EXTERN_MODULE(sway_xkb); +#endif +EXTERN_MODULE(river); EXTERN_MODULE(xkb); EXTERN_MODULE(xwindow); @@ -199,10 +201,12 @@ init(void) #if defined(PLUGIN_ENABLED_SCRIPT) REGISTER_CORE_MODULE(script, script); #endif +#if defined(PLUGIN_ENABLED_SWAY_XKB) + REGISTER_CORE_MODULE(sway-xkb, sway_xkb); +#endif #if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif - REGISTER_CORE_MODULE(sway-xkb, sway_xkb); #if defined(HAVE_PLUGIN_xkb) REGISTER_CORE_MODULE(xkb, xkb); #endif From a14d38b0cb0834a9147ed3ff64bfaf87a199adce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 09:58:45 +0100 Subject: [PATCH 16/25] =?UTF-8?q?meson:=20make=20=E2=80=98xkb=E2=80=99=20p?= =?UTF-8?q?lugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 10 +++++++--- plugin.c | 10 ++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 3223683..874abf6 100644 --- a/meson.build +++ b/meson.build @@ -149,6 +149,7 @@ yambar = executable( plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [], plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], + plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [], ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, @@ -204,6 +205,7 @@ summary( 'Removables monitoring': plugin_removables_enabled, 'Script': plugin_script_enabled, 'Sway XKB keyboard': plugin_sway_xkb_enabled, + 'XKB keyboard (for X11)': plugin_xkb_enabled, }, section: 'Optional modules', bool_yn: true diff --git a/meson_options.txt b/meson_options.txt index 6c85875..faa64a4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -40,3 +40,5 @@ option('plugin-script', type: 'feature', value: 'auto', description: 'Script support') option('plugin-sway-xkb', type: 'feature', value: 'auto', description: 'keyboard support for Sway') +option('plugin-xkb', type: 'feature', value: 'auto', + description: 'keyboard support for X11') diff --git a/modules/meson.build b/modules/meson.build index 9964b00..a89fed0 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -2,8 +2,6 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft]) modules = [] -xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11')) - # Optional deps alsa = dependency('alsa', required: get_option('plugin-alsa')) plugin_alsa_enabled = alsa.found() @@ -44,6 +42,9 @@ plugin_script_enabled = get_option('plugin-script').allowed() json_sway_xkb = dependency('json-c', required: get_option('plugin-sway-xkb')) plugin_sway_xkb_enabled = json_sway_xkb.found() +xcb_xkb = dependency('xcb-xkb', required: get_option('plugin-xkb')) +plugin_xkb_enabled = backend_x11 and xcb_xkb.found() + # Module name -> (source-list, dep-list) mod_data = {} @@ -115,9 +116,12 @@ if plugin_sway_xkb_enabled mod_data += {'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json_sway_xkb]]} endif +if plugin_xkb_enabled + mod_data += {'xkb': [[], [xcb_stuff, xcb_xkb]]} +endif + if backend_x11 mod_data += { - 'xkb': [[], [xcb_stuff, xcb_xkb]], 'xwindow': [[], [xcb_stuff]], } endif diff --git a/plugin.c b/plugin.c index 79936cd..5b4024a 100644 --- a/plugin.c +++ b/plugin.c @@ -84,8 +84,10 @@ EXTERN_MODULE(script); #if defined(PLUGIN_ENABLED_SWAY_XKB) EXTERN_MODULE(sway_xkb); #endif -EXTERN_MODULE(river); +#if defined(PLUGIN_ENABLED_XKB) EXTERN_MODULE(xkb); +#endif +EXTERN_MODULE(river); EXTERN_MODULE(xwindow); EXTERN_PARTICLE(empty); @@ -204,12 +206,12 @@ init(void) #if defined(PLUGIN_ENABLED_SWAY_XKB) REGISTER_CORE_MODULE(sway-xkb, sway_xkb); #endif +#if defined(PLUGIN_ENABLED_XKB) + REGISTER_CORE_MODULE(xkb, xkb); +#endif #if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif -#if defined(HAVE_PLUGIN_xkb) - REGISTER_CORE_MODULE(xkb, xkb); -#endif #if defined(HAVE_PLUGIN_xwindow) REGISTER_CORE_MODULE(xwindow, xwindow); #endif From 1a8125557943127d8e4cc6003d2589dd38e17efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:02:13 +0100 Subject: [PATCH 17/25] =?UTF-8?q?meson:=20make=20=E2=80=98xwindow=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 8 ++++---- plugin.c | 10 ++++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 874abf6..e2c332b 100644 --- a/meson.build +++ b/meson.build @@ -150,6 +150,7 @@ yambar = executable( plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [], + plugin_xwindow_enabled ? '-DPLUGIN_ENABLED_XWINDOW' : [], ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, @@ -206,6 +207,7 @@ summary( 'Script': plugin_script_enabled, 'Sway XKB keyboard': plugin_sway_xkb_enabled, 'XKB keyboard (for X11)': plugin_xkb_enabled, + 'XWindow': plugin_xwindow_enabled, }, section: 'Optional modules', bool_yn: true diff --git a/meson_options.txt b/meson_options.txt index faa64a4..46c0abb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -42,3 +42,5 @@ option('plugin-sway-xkb', type: 'feature', value: 'auto', description: 'keyboard support for Sway') option('plugin-xkb', type: 'feature', value: 'auto', description: 'keyboard support for X11') +option('plugin-xwindow', type: 'feature', value: 'auto', + description: 'XWindow support') diff --git a/modules/meson.build b/modules/meson.build index a89fed0..f1c8f41 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -45,6 +45,8 @@ plugin_sway_xkb_enabled = json_sway_xkb.found() xcb_xkb = dependency('xcb-xkb', required: get_option('plugin-xkb')) plugin_xkb_enabled = backend_x11 and xcb_xkb.found() +plugin_xwindow_enabled = backend_x11 and get_option('plugin-xwindow').allowed() + # Module name -> (source-list, dep-list) mod_data = {} @@ -120,10 +122,8 @@ if plugin_xkb_enabled mod_data += {'xkb': [[], [xcb_stuff, xcb_xkb]]} endif -if backend_x11 - mod_data += { - 'xwindow': [[], [xcb_stuff]], - } +if plugin_xwindow_enabled + mod_data += {'xwindow': [[], [xcb_stuff]]} endif if backend_wayland diff --git a/plugin.c b/plugin.c index 5b4024a..b7fc913 100644 --- a/plugin.c +++ b/plugin.c @@ -87,8 +87,10 @@ EXTERN_MODULE(sway_xkb); #if defined(PLUGIN_ENABLED_XKB) EXTERN_MODULE(xkb); #endif -EXTERN_MODULE(river); +#if defined(PLUGIN_ENABLED_XWINDOW) EXTERN_MODULE(xwindow); +#endif +EXTERN_MODULE(river); EXTERN_PARTICLE(empty); EXTERN_PARTICLE(list); @@ -209,12 +211,12 @@ init(void) #if defined(PLUGIN_ENABLED_XKB) REGISTER_CORE_MODULE(xkb, xkb); #endif +#if defined(PLUGIN_ENABLED_XWINDOW) + REGISTER_CORE_MODULE(xwindow, xwindow); +#endif #if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif -#if defined(HAVE_PLUGIN_xwindow) - REGISTER_CORE_MODULE(xwindow, xwindow); -#endif REGISTER_CORE_PARTICLE(empty, empty); REGISTER_CORE_PARTICLE(list, list); From 56b0047004410bb592a3d9f53a9a7b840dfa2744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:05:23 +0100 Subject: [PATCH 18/25] =?UTF-8?q?meson:=20make=20=E2=80=98river=E2=80=99?= =?UTF-8?q?=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 2 ++ meson_options.txt | 2 ++ modules/meson.build | 10 ++++++---- plugin.c | 10 ++++++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index e2c332b..e40f488 100644 --- a/meson.build +++ b/meson.build @@ -147,6 +147,7 @@ yambar = executable( plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [], + plugin_river_enabled ? '-DPLUGIN_ENABLED_RIVER' : [], plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [], @@ -204,6 +205,7 @@ summary( 'Pipewire': plugin_pipewire_enabled, 'PulseAudio': plugin_pulse_enabled, 'Removables monitoring': plugin_removables_enabled, + 'River': plugin_river_enabled, 'Script': plugin_script_enabled, 'Sway XKB keyboard': plugin_sway_xkb_enabled, 'XKB keyboard (for X11)': plugin_xkb_enabled, diff --git a/meson_options.txt b/meson_options.txt index 46c0abb..e5ab795 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,6 +36,8 @@ option('plugin-pulse', type: 'feature', value: 'auto', description: 'PulseAudio support') option('plugin-removables', type: 'feature', value: 'auto', description: 'Removables (USB sticks, CD-ROM etc) monitoring support') +option('plugin-river', type: 'feature', value: 'auto', + description: 'River support') option('plugin-script', type: 'feature', value: 'auto', description: 'Script support') option('plugin-sway-xkb', type: 'feature', value: 'auto', diff --git a/modules/meson.build b/modules/meson.build index f1c8f41..933a195 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -37,6 +37,8 @@ plugin_pulse_enabled = pulse.found() udev_removables = dependency('udev', required: get_option('plugin-removables')) plugin_removables_enabled = udev_removables.found() +plugin_river_enabled = backend_wayland and get_option('plugin-river').allowed() + plugin_script_enabled = get_option('plugin-script').allowed() json_sway_xkb = dependency('json-c', required: get_option('plugin-sway-xkb')) @@ -126,7 +128,7 @@ if plugin_xwindow_enabled mod_data += {'xwindow': [[], [xcb_stuff]]} endif -if backend_wayland +if plugin_river_enabled river_proto_headers = [] river_proto_src = [] @@ -145,10 +147,10 @@ if backend_wayland command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@']) endforeach - mod_data += { - 'river': [[wl_proto_src + wl_proto_headers + river_proto_src + river_proto_headers], [dynlist, wayland_client]], - } + mod_data += {'river': [[wl_proto_src + wl_proto_headers + river_proto_src + river_proto_headers], [dynlist, wayland_client]]} +endif +if backend_wayland ftop_proto_headers = [] ftop_proto_src = [] diff --git a/plugin.c b/plugin.c index b7fc913..7e47ee7 100644 --- a/plugin.c +++ b/plugin.c @@ -78,6 +78,9 @@ EXTERN_MODULE(pulse); #if defined(PLUGIN_ENABLED_REMOVABLES) EXTERN_MODULE(removables); #endif +#if defined(PLUGIN_ENABLED_RIVER) +EXTERN_MODULE(river); +#endif #if defined(PLUGIN_ENABLED_SCRIPT) EXTERN_MODULE(script); #endif @@ -90,7 +93,6 @@ EXTERN_MODULE(xkb); #if defined(PLUGIN_ENABLED_XWINDOW) EXTERN_MODULE(xwindow); #endif -EXTERN_MODULE(river); EXTERN_PARTICLE(empty); EXTERN_PARTICLE(list); @@ -202,6 +204,9 @@ init(void) #if defined(PLUGIN_ENABLED_REMOVABLES) REGISTER_CORE_MODULE(removables, removables); #endif +#if defined(PLUGIN_ENABLED_RIVER) + REGISTER_CORE_MODULE(river, river); +#endif #if defined(PLUGIN_ENABLED_SCRIPT) REGISTER_CORE_MODULE(script, script); #endif @@ -214,9 +219,6 @@ init(void) #if defined(PLUGIN_ENABLED_XWINDOW) REGISTER_CORE_MODULE(xwindow, xwindow); #endif -#if defined(HAVE_PLUGIN_river) - REGISTER_CORE_MODULE(river, river); -#endif REGISTER_CORE_PARTICLE(empty, empty); REGISTER_CORE_PARTICLE(list, list); From 9ef6d73663300c222521679ea24f42ced6540fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:08:48 +0100 Subject: [PATCH 19/25] =?UTF-8?q?meson:=20make=20=E2=80=98foreign-toplevel?= =?UTF-8?q?=E2=80=99=20plugin=20compile=20time=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 4 +++- meson_options.txt | 4 +++- modules/meson.build | 7 +++---- plugin.c | 4 +++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index e40f488..4e14277 100644 --- a/meson.build +++ b/meson.build @@ -139,6 +139,7 @@ yambar = executable( plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [], plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [], plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], + plugin_foreign_toplevel_enabled ? '-DPLUGIN_ENABLED_FOREIGN_TOPLEVEL' : [], plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [], plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [], @@ -197,6 +198,7 @@ summary( 'CPU monitoring': plugin_cpu_enabled, 'Disk I/O monitoring': plugin_disk_io_enabled, 'DWL (dwm for Wayland)': plugin_dwl_enabled, + 'Foreign toplevel (window tracking for Wayland)': plugin_foreign_toplevel_enabled, 'Memory monitoring': plugin_mem_enabled, 'Music Player Daemon (MPD)': plugin_mpd_enabled, 'i3+Sway': plugin_i3_enabled, @@ -209,7 +211,7 @@ summary( 'Script': plugin_script_enabled, 'Sway XKB keyboard': plugin_sway_xkb_enabled, 'XKB keyboard (for X11)': plugin_xkb_enabled, - 'XWindow': plugin_xwindow_enabled, + 'XWindow (window tracking for X11)': plugin_xwindow_enabled, }, section: 'Optional modules', bool_yn: true diff --git a/meson_options.txt b/meson_options.txt index e5ab795..03c0ead 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -20,6 +20,8 @@ option('plugin-disk-io', type: 'feature', value: 'auto', description: 'Disk I/O support') option('plugin-dwl', type: 'feature', value: 'auto', description: 'DWL (dwm for wayland) support') +option('plugin-foreign-toplevel', type: 'feature', value: 'auto', + description: 'Foreign toplevel (window tracking for Wayland) support') option('plugin-mem', type: 'feature', value: 'auto', description: 'Memory monitoring support') option('plugin-mpd', type: 'feature', value: 'auto', @@ -45,4 +47,4 @@ option('plugin-sway-xkb', type: 'feature', value: 'auto', option('plugin-xkb', type: 'feature', value: 'auto', description: 'keyboard support for X11') option('plugin-xwindow', type: 'feature', value: 'auto', - description: 'XWindow support') + description: 'XWindow (window tracking for X11) support') diff --git a/modules/meson.build b/modules/meson.build index 933a195..f14b3df 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -16,6 +16,7 @@ plugin_clock_enabled = get_option('plugin-clock').allowed() plugin_cpu_enabled = get_option('plugin-cpu').allowed() plugin_disk_io_enabled = get_option('plugin-disk-io').allowed() plugin_dwl_enabled = get_option('plugin-dwl').allowed() +plugin_foreign_toplevel_enabled = backend_wayland and get_option('plugin-foreign-toplevel').allowed() plugin_mem_enabled = get_option('plugin-mem').allowed() mpd = dependency('libmpdclient', required: get_option('plugin-mpd')) @@ -150,7 +151,7 @@ if plugin_river_enabled mod_data += {'river': [[wl_proto_src + wl_proto_headers + river_proto_src + river_proto_headers], [dynlist, wayland_client]]} endif -if backend_wayland +if plugin_foreign_toplevel_enabled ftop_proto_headers = [] ftop_proto_src = [] @@ -169,9 +170,7 @@ if backend_wayland command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@']) endforeach - mod_data += { - 'foreign-toplevel': [[wl_proto_src + wl_proto_headers + ftop_proto_headers + ftop_proto_src], [dynlist, wayland_client]], - } + mod_data += {'foreign-toplevel': [[wl_proto_src + wl_proto_headers + ftop_proto_headers + ftop_proto_src], [dynlist, wayland_client]]} endif foreach mod, data : mod_data diff --git a/plugin.c b/plugin.c index 7e47ee7..93fa771 100644 --- a/plugin.c +++ b/plugin.c @@ -53,7 +53,9 @@ EXTERN_MODULE(disk_io); #if defined(PLUGIN_ENABLED_DWL) EXTERN_MODULE(dwl); #endif +#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL) EXTERN_MODULE(foreign_toplevel); +#endif #if defined(PLUGIN_ENABLED_MEM) EXTERN_MODULE(mem); #endif @@ -177,7 +179,7 @@ init(void) #if defined(PLUGIN_ENABLED_DWL) REGISTER_CORE_MODULE(dwl, dwl); #endif -#if defined(HAVE_PLUGIN_foreign_toplevel) +#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL) REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel); #endif #if defined(PLUGIN_ENABLED_MEM) From 690bd630a2821b92587649e7bd86cff28b4192bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:16:54 +0100 Subject: [PATCH 20/25] plugin: use auto-generated defines for enabled plugins --- meson.build | 23 ---------- plugin.c | 126 ++++++++++++++++++++++++++-------------------------- 2 files changed, 63 insertions(+), 86 deletions(-) diff --git a/meson.build b/meson.build index 4e14277..6ad0463 100644 --- a/meson.build +++ b/meson.build @@ -131,29 +131,6 @@ yambar = executable( version, dependencies: [bar, libepoll, libinotify, pixman, yaml, threads, dl, tllist, fcft] + decorations + particles + modules, - c_args: [ - plugin_alsa_enabled ? '-DPLUGIN_ENABLED_ALSA' : [], - plugin_backlight_enabled ? '-DPLUGIN_ENABLED_BACKLIGHT' : [], - plugin_battery_enabled ? '-DPLUGIN_ENABLED_BATTERY' : [], - plugin_clock_enabled ? '-DPLUGIN_ENABLED_CLOCK' : [], - plugin_cpu_enabled ? '-DPLUGIN_ENABLED_CPU' : [], - plugin_disk_io_enabled ? '-DPLUGIN_ENABLED_DISK_IO' : [], - plugin_dwl_enabled ? '-DPLUGIN_ENABLED_DWL' : [], - plugin_foreign_toplevel_enabled ? '-DPLUGIN_ENABLED_FOREIGN_TOPLEVEL' : [], - plugin_mem_enabled ? '-DPLUGIN_ENABLED_MEM' : [], - plugin_mpd_enabled ? '-DPLUGIN_ENABLED_MPD' : [], - plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [], - plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [], - plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [], - plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [], - plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [], - plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [], - plugin_river_enabled ? '-DPLUGIN_ENABLED_RIVER' : [], - plugin_script_enabled ? '-DPLUGIN_ENABLED_SCRIPT' : [], - plugin_sway_xkb_enabled ? '-DPLUGIN_ENABLED_SWAY_XKB' : [], - plugin_xkb_enabled ? '-DPLUGIN_ENABLED_XKB' : [], - plugin_xwindow_enabled ? '-DPLUGIN_ENABLED_XWINDOW' : [], - ], build_rpath: '$ORIGIN/modules:$ORIGIN/decorations:$ORIGIN/particles', export_dynamic: true, install: true, diff --git a/plugin.c b/plugin.c index 93fa771..ed7f63c 100644 --- a/plugin.c +++ b/plugin.c @@ -32,68 +32,68 @@ keychain_t *chain, const struct yml_node *node); \ extern struct deco *plug_name##_from_conf(const struct yml_node *node); -#if defined(PLUGIN_ENABLED_ALSA) -EXTERN_MODULE(alsa); +#if defined(HAVE_PLUGIN_alsa) + EXTERN_MODULE(alsa); #endif -#if defined(PLUGIN_ENABLED_BACKLIGHT) -EXTERN_MODULE(backlight); +#if defined(HAVE_PLUGIN_backlight) + EXTERN_MODULE(backlight); #endif -#if defined(PLUGIN_ENABLED_BATTERY) -EXTERN_MODULE(battery); +#if defined(HAVE_PLUGIN_battery) + EXTERN_MODULE(battery); #endif -#if defined(PLUGIN_ENABLED_CLOCK) -EXTERN_MODULE(clock); +#if defined(HAVE_PLUGIN_clock) + EXTERN_MODULE(clock); #endif -#if defined(PLUGIN_ENABLED_CPU) -EXTERN_MODULE(cpu); +#if defined(HAVE_PLUGIN_cpu) + EXTERN_MODULE(cpu); #endif -#if defined(PLUGIN_ENABLED_DISK_IO) -EXTERN_MODULE(disk_io); +#if defined(HAVE_PLUGIN_disk_io) + EXTERN_MODULE(disk_io); #endif -#if defined(PLUGIN_ENABLED_DWL) -EXTERN_MODULE(dwl); +#if defined(HAVE_PLUGIN_dwl) + EXTERN_MODULE(dwl); #endif -#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL) -EXTERN_MODULE(foreign_toplevel); +#if defined(HAVE_PLUGIN_foreign_toplevel) + EXTERN_MODULE(foreign_toplevel); #endif -#if defined(PLUGIN_ENABLED_MEM) -EXTERN_MODULE(mem); +#if defined(HAVE_PLUGIN_mem) + EXTERN_MODULE(mem); #endif -#if defined(PLUGIN_ENABLED_MPD) -EXTERN_MODULE(mpd); +#if defined(HAVE_PLUGIN_mpd) + EXTERN_MODULE(mpd); #endif -#if defined(PLUGIN_ENABLED_I3) -EXTERN_MODULE(i3); +#if defined(HAVE_PLUGIN_i3) + EXTERN_MODULE(i3); #endif -#if defined(PLUGIN_ENABLED_LABEL) -EXTERN_MODULE(label); +#if defined(HAVE_PLUGIN_label) + EXTERN_MODULE(label); #endif -#if defined(PLUGIN_ENABLED_NETWORK) -EXTERN_MODULE(network); +#if defined(HAVE_PLUGIN_network) + EXTERN_MODULE(network); #endif -#if defined(PLUGIN_ENABLED_PIPEWIRE) -EXTERN_MODULE(pipewire); +#if defined(HAVE_PLUGIN_pipewire) + EXTERN_MODULE(pipewire); #endif -#if defined(PLUGIN_ENABLED_PULSE) -EXTERN_MODULE(pulse); +#if defined(HAVE_PLUGIN_pulse) + EXTERN_MODULE(pulse); #endif -#if defined(PLUGIN_ENABLED_REMOVABLES) -EXTERN_MODULE(removables); +#if defined(HAVE_PLUGIN_removables) + EXTERN_MODULE(removables); #endif -#if defined(PLUGIN_ENABLED_RIVER) -EXTERN_MODULE(river); +#if defined(HAVE_PLUGIN_river) + EXTERN_MODULE(river); #endif -#if defined(PLUGIN_ENABLED_SCRIPT) -EXTERN_MODULE(script); +#if defined(HAVE_PLUGIN_script) + EXTERN_MODULE(script); #endif -#if defined(PLUGIN_ENABLED_SWAY_XKB) -EXTERN_MODULE(sway_xkb); +#if defined(HAVE_PLUGIN_sway_xkb) + EXTERN_MODULE(sway_xkb); #endif -#if defined(PLUGIN_ENABLED_XKB) -EXTERN_MODULE(xkb); +#if defined(HAVE_PLUGIN_xkb) + EXTERN_MODULE(xkb); #endif -#if defined(PLUGIN_ENABLED_XWINDOW) -EXTERN_MODULE(xwindow); +#if defined(HAVE_PLUGIN_xwindow) + EXTERN_MODULE(xwindow); #endif EXTERN_PARTICLE(empty); @@ -158,67 +158,67 @@ init(void) tll_back(plugins).decoration = &deco_##func_prefix##_iface; \ } while (0) -#if defined(PLUGIN_ENABLED_ALSA) +#if defined(HAVE_PLUGIN_alsa) REGISTER_CORE_MODULE(alsa, alsa); #endif -#if defined(PLUGIN_ENABLED_BACKLIGHT) +#if defined(HAVE_PLUGIN_backlight) REGISTER_CORE_MODULE(backlight, backlight); #endif -#if defined(PLUGIN_ENABLED_BATTERY) +#if defined(HAVE_PLUGIN_battery) REGISTER_CORE_MODULE(battery, battery); #endif -#if defined(PLUGIN_ENABLED_CLOCK) +#if defined(HAVE_PLUGIN_clock) REGISTER_CORE_MODULE(clock, clock); #endif -#if defined(PLUGIN_ENABLED_CPU) +#if defined(HAVE_PLUGIN_cpu) REGISTER_CORE_MODULE(cpu, cpu); #endif -#if defined(PLUGIN_ENABLED_DISK_IO) +#if defined(HAVE_PLUGIN_disk_io) REGISTER_CORE_MODULE(disk-io, disk_io); #endif -#if defined(PLUGIN_ENABLED_DWL) +#if defined(HAVE_PLUGIN_dwl) REGISTER_CORE_MODULE(dwl, dwl); #endif -#if defined(PLUGIN_ENABLED_FOREIGN_TOPLEVEL) +#if defined(HAVE_PLUGIN_foreign_toplevel) REGISTER_CORE_MODULE(foreign-toplevel, foreign_toplevel); #endif -#if defined(PLUGIN_ENABLED_MEM) +#if defined(HAVE_PLUGIN_mem) REGISTER_CORE_MODULE(mem, mem); #endif -#if defined(PLUGIN_ENABLED_MPD) +#if defined(HAVE_PLUGIN_mpd) REGISTER_CORE_MODULE(mpd, mpd); #endif -#if defined(PLUGIN_ENABLED_I3) +#if defined(HAVE_PLUGIN_i3) REGISTER_CORE_MODULE(i3, i3); #endif -#if defined(PLUGIN_ENABLED_LABEL) +#if defined(HAVE_PLUGIN_label) REGISTER_CORE_MODULE(label, label); #endif -#if defined(PLUGIN_ENABLED_NETWORK) +#if defined(HAVE_PLUGIN_network) REGISTER_CORE_MODULE(network, network); #endif -#if defined(PLUGIN_ENABLED_PIPEWIRE) +#if defined(HAVE_PLUGIN_pipewire) REGISTER_CORE_MODULE(pipewire, pipewire); #endif -#if defined(PLUGIN_ENABLED_PULSE) +#if defined(HAVE_PLUGIN_pulse) REGISTER_CORE_MODULE(pulse, pulse); #endif -#if defined(PLUGIN_ENABLED_REMOVABLES) +#if defined(HAVE_PLUGIN_removables) REGISTER_CORE_MODULE(removables, removables); #endif -#if defined(PLUGIN_ENABLED_RIVER) +#if defined(HAVE_PLUGIN_river) REGISTER_CORE_MODULE(river, river); #endif -#if defined(PLUGIN_ENABLED_SCRIPT) +#if defined(HAVE_PLUGIN_script) REGISTER_CORE_MODULE(script, script); #endif -#if defined(PLUGIN_ENABLED_SWAY_XKB) +#if defined(HAVE_PLUGIN_sway_xkb) REGISTER_CORE_MODULE(sway-xkb, sway_xkb); #endif -#if defined(PLUGIN_ENABLED_XKB) +#if defined(HAVE_PLUGIN_xkb) REGISTER_CORE_MODULE(xkb, xkb); #endif -#if defined(PLUGIN_ENABLED_XWINDOW) +#if defined(HAVE_PLUGIN_xwindow) REGISTER_CORE_MODULE(xwindow, xwindow); #endif From a5e79d14b79a092d23d178cbae2c3bd8b7f20622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:18:18 +0100 Subject: [PATCH 21/25] pkgbuild: add pipewire dependency --- PKGBUILD | 1 + PKGBUILD.wayland-only | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index b675823..8f20543 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -16,6 +16,7 @@ depends=( 'json-c' 'libmpdclient' 'libpulse' + 'pipewire' 'fcft>=3.0.0' 'fcft<4.0.0') optdepends=('xcb-util-errors: better X error messages') source=() diff --git a/PKGBUILD.wayland-only b/PKGBUILD.wayland-only index e836093..cc956e9 100644 --- a/PKGBUILD.wayland-only +++ b/PKGBUILD.wayland-only @@ -1,5 +1,5 @@ pkgname=yambar-wayland -pkgver=1.8.0 +pkgver=1.8.0.r111.g690bd63 pkgrel=1 pkgdesc="Simplistic and highly configurable status panel for Wayland" arch=('x86_64' 'aarch64') @@ -17,6 +17,7 @@ depends=( 'json-c' 'libmpdclient' 'libpulse' + 'pipewire' 'fcft>=3.0.0' 'fcft<4.0.0') source=() From a53e48a2c16dcfd80b9b1c91063a3177f4f55918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:25:25 +0100 Subject: [PATCH 22/25] doc: meson: only install man pages for modules we actually build --- doc/meson.build | 83 +++++++++++++++++++++++++++++++++++++++---------- meson.build | 2 +- 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index e561ef3..fa9673d 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -3,22 +3,73 @@ sh = find_program('sh', native: true) scdoc = dependency('scdoc', native: true) scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true) -foreach man_src : ['yambar.1.scd', 'yambar.5.scd', 'yambar-decorations.5.scd', - 'yambar-modules-alsa.5.scd', 'yambar-modules-backlight.5.scd', - 'yambar-modules-battery.5.scd', 'yambar-modules-clock.5.scd', - 'yambar-modules-disk-io.5.scd', 'yambar-modules-dwl.5.scd', - 'yambar-modules-foreign-toplevel.5.scd', - 'yambar-modules-i3.5.scd', 'yambar-modules-label.5.scd', - 'yambar-modules-mpd.5.scd', 'yambar-modules-network.5.scd', - 'yambar-modules-pulse.5.scd', - 'yambar-modules-pipewire.5.scd', - 'yambar-modules-removables.5.scd', 'yambar-modules-river.5.scd', - 'yambar-modules-script.5.scd', 'yambar-modules-sway-xkb.5.scd', - 'yambar-modules-sway.5.scd', 'yambar-modules-xkb.5.scd', - 'yambar-modules-xwindow.5.scd', 'yambar-modules.5.scd', - 'yambar-modules-cpu.5.scd', - 'yambar-modules-mem.5.scd', - 'yambar-particles.5.scd', 'yambar-tags.5.scd'] +plugin_pages = [] +if plugin_alsa_enabled + plugin_pages += ['yambar-modules-alsa.5.scd'] +endif +if plugin_backlight_enabled + plugin_pages += ['yambar-modules-backlight.5.scd'] +endif +if plugin_battery_enabled + plugin_pages += ['yambar-modules-battery.5.scd'] +endif +if plugin_clock_enabled + plugin_pages += ['yambar-modules-clock.5.scd'] +endif +if plugin_cpu_enabled + plugin_pages += ['yambar-modules-cpu.5.scd'] +endif +if plugin_disk_io_enabled + plugin_pages += ['yambar-modules-disk-io.5.scd'] +endif +if plugin_dwl_enabled + plugin_pages += ['yambar-modules-dwl.5.scd'] +endif +if plugin_foreign_toplevel_enabled + plugin_pages += ['yambar-modules-foreign-toplevel.5.scd'] +endif +if plugin_mem_enabled + plugin_pages += ['yambar-modules-mem.5.scd'] +endif +if plugin_mpd_enabled + plugin_pages += ['yambar-modules-mpd.5.scd'] +endif +if plugin_i3_enabled + plugin_pages += ['yambar-modules-i3.5.scd'] +endif +if plugin_label_enabled + plugin_pages += ['yambar-modules-label.5.scd'] +endif +if plugin_network_enabled + plugin_pages += ['yambar-modules-network.5.scd'] +endif +if plugin_pipewire_enabled + plugin_pages += ['yambar-modules-pipewire.5.scd'] +endif +if plugin_pulse_enabled + plugin_pages += ['yambar-modules-pulse.5.scd'] +endif +if plugin_removables_enabled + plugin_pages += ['yambar-modules-removables.5.scd'] +endif +if plugin_river_enabled + plugin_pages += ['yambar-modules-river.5.scd'] +endif +if plugin_script_enabled + plugin_pages += ['yambar-modules-script.5.scd'] +endif +if plugin_sway_xkb_enabled + plugin_pages += ['yambar-modules-sway-xkb.5.scd'] +endif +if plugin_xkb_enabled + plugin_pages += ['yambar-modules-xkb.5.scd'] +endif + +foreach man_src : ['yambar.1.scd', + 'yambar.5.scd', + 'yambar-decorations.5.scd', + 'yambar-particles.5.scd', + 'yambar-tags.5.scd'] + plugin_pages parts = man_src.split('.') name = parts[-3] section = parts[-2] diff --git a/meson.build b/meson.build index 6ad0463..3f02985 100644 --- a/meson.build +++ b/meson.build @@ -99,11 +99,11 @@ if backend_x11 endif subdir('completions') -subdir('doc') subdir('bar') subdir('decorations') subdir('particles') subdir('modules') +subdir('doc') env = find_program('env', native: true) generate_version_sh = files('generate-version.sh') From c4cc1b7a360d1a3e512c651f68aa766af5031bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:30:20 +0100 Subject: [PATCH 23/25] changelog: all modules are now compile-time optional --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddde62d..8360e27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ ### Changed +* All modules are now compile-time optional. * Minimum required meson version is now 0.59. * Float tags are now treated as floats instead of integers when formatted with the `kb`/`kib`/`mb`/`mib`/`gb`/`gib` string particle From b22614ecc3f707c8d1f392991ee39e43fddc1c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 10:54:26 +0100 Subject: [PATCH 24/25] ci (woodpecker): add pipewire-dev to x86 builds Before this, it was only added in the x64 builds --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 02fd5f6..058b08a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -95,7 +95,7 @@ pipeline: - apk add pixman-dev freetype-dev fontconfig-dev - apk add libxcb-dev xcb-util-wm-dev xcb-util-cursor-dev yaml-dev - apk add wayland-dev wayland-protocols wlroots-dev - - apk add json-c-dev libmpdclient-dev alsa-lib-dev pulseaudio-dev + - apk add json-c-dev libmpdclient-dev alsa-lib-dev pulseaudio-dev pipewire-dev - apk add ttf-dejavu - apk add git - apk add flex bison From 95b1f5f2618f8e0cf1e3b9aad836dd6fc5f46bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Dec 2022 11:01:05 +0100 Subject: [PATCH 25/25] =?UTF-8?q?modules:=20meson:=20regression:=20it?= =?UTF-8?q?=E2=80=99s=20=E2=80=98libudev=E2=80=99,=20not=20=E2=80=98udev?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/meson.build b/modules/meson.build index f14b3df..066e5d9 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -35,7 +35,7 @@ plugin_pipewire_enabled = pipewire.found() and json_pipewire.found() pulse = dependency('libpulse', required: get_option('plugin-pulse')) plugin_pulse_enabled = pulse.found() -udev_removables = dependency('udev', required: get_option('plugin-removables')) +udev_removables = dependency('libudev', required: get_option('plugin-removables')) plugin_removables_enabled = udev_removables.found() plugin_river_enabled = backend_wayland and get_option('plugin-river').allowed()