From 4d775008df1cabaa6a9cfd56dfb75fa5d83d54b1 Mon Sep 17 00:00:00 2001 From: wjoe Date: Fri, 14 Aug 2020 20:59:30 +0200 Subject: [PATCH] only return a bluetooth module from factory if the rfkill feature is enabled. --- include/factory.hpp | 4 +++- src/factory.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/factory.hpp b/include/factory.hpp index fcbf3a2d..ebc2359f 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -43,7 +43,9 @@ #include "modules/custom.hpp" #include "modules/temperature.hpp" #if defined(__linux__) -#include "modules/bluetooth.hpp" +# ifdef WANT_RFKILL +# include "modules/bluetooth.hpp" +# endif #endif namespace waybar { diff --git a/src/factory.cpp b/src/factory.cpp index 5a01d523..af93b20f 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -81,9 +81,11 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { return new waybar::modules::Temperature(id, config_[name]); } #if defined(__linux__) +# ifdef WANT_RFKILL if (ref == "bluetooth") { return new waybar::modules::Bluetooth(id, config_[name]); } +# endif #endif if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) { return new waybar::modules::Custom(ref.substr(7), id, config_[name]);