Merge pull request #1397 from JakeStanger/feat/image-module

Resolves https://github.com/Alexays/Waybar/issues/1191
This commit is contained in:
Alex
2022-11-24 20:40:56 +01:00
committed by GitHub
6 changed files with 169 additions and 0 deletions

View File

@ -148,6 +148,8 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const {
}
if (ref.compare(0, 7, "custom/") == 0 && ref.size() > 7) {
return new waybar::modules::Custom(ref.substr(7), id, config_[name]);
} else if (ref.compare(0, 6, "image/") == 0 && ref.size() > 6) {
return new waybar::modules::Image(ref.substr(6), id, config_[name]);
}
} catch (const std::exception& e) {
auto err = fmt::format("Disabling module \"{}\", {}", name, e.what());