diff --git a/include/config.hpp.cmake b/include/config.hpp.cmake index 2fd4432d..acea5c39 100644 --- a/include/config.hpp.cmake +++ b/include/config.hpp.cmake @@ -2,10 +2,10 @@ #define APP_NAME "@PROJECT_NAME@" -#cmakedefine ENABLE_ALSA true -#cmakedefine ENABLE_MPD true -#cmakedefine ENABLE_NETWORK true -#cmakedefine ENABLE_I3 true +#cmakedefine01 ENABLE_ALSA +#cmakedefine01 ENABLE_MPD +#cmakedefine01 ENABLE_NETWORK +#cmakedefine01 ENABLE_I3 #define BUILDER_SPACE_TOKEN "%__" #define ALSA_SOUNDCARD "@SETTING_ALSA_SOUNDCARD@" diff --git a/src/bar.cpp b/src/bar.cpp index 0c5192f5..1b12330c 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -14,16 +14,16 @@ #include "modules/menu.hpp" #include "modules/script.hpp" #include "modules/text.hpp" -#ifdef ENABLE_I3 +#if ENABLE_I3 #include "modules/i3.hpp" #endif -#ifdef ENABLE_MPD +#if ENABLE_MPD #include "modules/mpd.hpp" #endif -#ifdef ENABLE_NETWORK +#if ENABLE_NETWORK #include "modules/network.hpp" #endif -#ifdef ENABLE_ALSA +#if ENABLE_ALSA #include "modules/volume.hpp" #endif @@ -156,10 +156,18 @@ void Bar::load() else if (type == "internal/cpu") module = std::make_unique(mod); else if (type == "internal/date") module = std::make_unique(mod); else if (type == "internal/memory") module = std::make_unique(mod); + #if ENABLE_I3 else if (type == "internal/i3") module = std::make_unique(mod, this->opts->monitor->name); + #endif + #if ENABLE_MPD else if (type == "internal/mpd") module = std::make_unique(mod); + #endif + #if ENABLE_ALSA else if (type == "internal/volume") module = std::make_unique(mod); + #endif + #if ENABLE_NETWORK else if (type == "internal/network") module = std::make_unique(mod); + #endif else if (type == "custom/text") module = std::make_unique(mod); else if (type == "custom/script") module = std::make_unique(mod); else if (type == "custom/menu") module = std::make_unique(mod);