diff --git a/include/modules/unsupported.hpp b/include/modules/unsupported.hpp index e708cc45..bfaf3311 100644 --- a/include/modules/unsupported.hpp +++ b/include/modules/unsupported.hpp @@ -1,5 +1,5 @@ #pragma once -#if ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA +#if ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA && WITH_XKB #error "Support has been enabled for all optional modules" #endif @@ -12,6 +12,9 @@ #if not ENABLE_NETWORK #include "modules/meta/timer_module.inl" #endif +#if not WITH_XKB +#include "modules/meta/static_module.inl" +#endif POLYBAR_NS @@ -59,6 +62,9 @@ namespace modules { #if not ENABLE_ALSA DEFINE_UNSUPPORTED_MODULE(volume_module, "internal/volume"); #endif +#if not WITH_XKB + DEFINE_UNSUPPORTED_MODULE(xkeyboard_module, "internal/xkeyboard"); +#endif } POLYBAR_NS_END diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 821b84e8..237ea5dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,6 +19,25 @@ if(NOT ENABLE_I3) list(REMOVE_ITEM SOURCES modules/i3.cpp utils/i3.cpp) endif() +if(NOT WITH_XCOMPOSITE) + list(REMOVE_ITEM SOURCES x11/composite.cpp) +endif() +if(NOT WITH_XDAMAGE) + list(REMOVE_ITEM SOURCES x11/damage.cpp) +endif() +if(NOT WITH_XRANDR) + list(REMOVE_ITEM SOURCES x11/randr.cpp) +endif() +if(NOT WITH_XRENDER) + list(REMOVE_ITEM SOURCES x11/render.cpp) +endif() +if(NOT WITH_XSYNC) + list(REMOVE_ITEM SOURCES x11/sync.cpp) +endif() +if(NOT WITH_XKB) + list(REMOVE_ITEM SOURCES x11/xkb.cpp modules/xkeyboard.cpp) +endif() + # }}} # Locate dependencies {{{ diff --git a/src/components/controller.cpp b/src/components/controller.cpp index fa856893..19bcabda 100644 --- a/src/components/controller.cpp +++ b/src/components/controller.cpp @@ -23,7 +23,6 @@ #include "modules/temperature.hpp" #include "modules/text.hpp" #include "modules/xbacklight.hpp" -#include "modules/xkeyboard.hpp" #include "modules/xwindow.hpp" #include "modules/xworkspaces.hpp" #include "utils/process.hpp" @@ -41,8 +40,11 @@ #if ENABLE_ALSA #include "modules/volume.hpp" #endif +#if WITH_XKB +#include "modules/xkeyboard.hpp" +#endif -#if not(ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA) +#if not(ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA && WITH_XKB) #include "modules/unsupported.hpp" #endif