diff --git a/include/modules/custom.hpp b/include/modules/custom.hpp index 28169720..40320cfc 100644 --- a/include/modules/custom.hpp +++ b/include/modules/custom.hpp @@ -12,7 +12,7 @@ namespace waybar::modules { class Custom : public ALabel { public: - Custom(const std::string&, const Json::Value&); + Custom(const std::string&, const std::string&, const Json::Value&); ~Custom(); auto update() -> void; void refresh(int /*signal*/); diff --git a/src/factory.cpp b/src/factory.cpp index 100ca146..9fd7671e 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -64,7 +64,7 @@ waybar::IModule* waybar::Factory::makeModule(const std::string& name) const { return new waybar::modules::Temperature(id, config_[name]); } if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) { - return new waybar::modules::Custom(ref.substr(7), config_[name]); + return new waybar::modules::Custom(ref.substr(7), id, config_[name]); } } catch (const std::exception& e) { auto err = fmt::format("Disabling module \"{}\", {}", name, e.what()); diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index c4ffcaf8..280583dc 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -1,8 +1,9 @@ #include "modules/custom.hpp" #include -waybar::modules::Custom::Custom(const std::string& name, const Json::Value& config) - : ALabel(config, "custom-" + name_, name, "{}"), name_(name), fp_(nullptr), pid_(-1) { +waybar::modules::Custom::Custom(const std::string& name, const std::string& id, + const Json::Value& config) + : ALabel(config, "custom-" + name_, id, "{}"), name_(name), fp_(nullptr), pid_(-1) { if (config_["exec"].isString()) { if (interval_.count() > 0) { delayWorker();