only return a bluetooth module from factory if the rfkill feature is enabled.
This commit is contained in:
parent
4565f7f8b9
commit
4d775008df
|
@ -43,8 +43,10 @@
|
||||||
#include "modules/custom.hpp"
|
#include "modules/custom.hpp"
|
||||||
#include "modules/temperature.hpp"
|
#include "modules/temperature.hpp"
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
# ifdef WANT_RFKILL
|
||||||
# include "modules/bluetooth.hpp"
|
# include "modules/bluetooth.hpp"
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace waybar {
|
namespace waybar {
|
||||||
|
|
||||||
|
|
|
@ -81,9 +81,11 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const {
|
||||||
return new waybar::modules::Temperature(id, config_[name]);
|
return new waybar::modules::Temperature(id, config_[name]);
|
||||||
}
|
}
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
# ifdef WANT_RFKILL
|
||||||
if (ref == "bluetooth") {
|
if (ref == "bluetooth") {
|
||||||
return new waybar::modules::Bluetooth(id, config_[name]);
|
return new waybar::modules::Bluetooth(id, config_[name]);
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) {
|
if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) {
|
||||||
return new waybar::modules::Custom(ref.substr(7), id, config_[name]);
|
return new waybar::modules::Custom(ref.substr(7), id, config_[name]);
|
||||||
|
|
Loading…
Reference in New Issue