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

34
include/modules/image.hpp Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <fmt/format.h>
#include <gtkmm/image.h>
#include <csignal>
#include <string>
#include "ALabel.hpp"
#include "util/command.hpp"
#include "util/json.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class Image : public AModule {
public:
Image(const std::string&, const std::string&, const Json::Value&);
auto update() -> void;
void refresh(int /*signal*/);
private:
void delayWorker();
void handleEvent();
Gtk::Image image_;
std::string path_;
int size_;
int interval_;
util::SleeperThread thread_;
};
} // namespace waybar::modules