feat: image module

Module which renders an image onto the bar.
This commit is contained in:
Jake Stanger
2022-01-16 23:55:13 +00:00
parent 81f0bcb3a3
commit a650c7d90c
6 changed files with 169 additions and 0 deletions

View File

@ -112,6 +112,8 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const {
#endif
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());