only return a bluetooth module from factory if the rfkill feature is enabled.

This commit is contained in:
wjoe 2020-08-14 20:59:30 +02:00
parent 4565f7f8b9
commit 4d775008df
2 changed files with 5 additions and 1 deletions

View File

@ -43,8 +43,10 @@
#include "modules/custom.hpp"
#include "modules/temperature.hpp"
#if defined(__linux__)
# ifdef WANT_RFKILL
# include "modules/bluetooth.hpp"
# endif
#endif
namespace waybar {

View File

@ -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]);