2022-01-16 23:55:13 +00:00
|
|
|
#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();
|
|
|
|
|
2023-01-04 15:26:50 +00:00
|
|
|
Gtk::Image image_;
|
2022-01-16 23:55:13 +00:00
|
|
|
std::string path_;
|
2023-01-04 15:26:50 +00:00
|
|
|
int size_;
|
|
|
|
int interval_;
|
2023-01-25 16:58:07 +00:00
|
|
|
util::command::res output_;
|
2022-01-16 23:55:13 +00:00
|
|
|
|
|
|
|
util::SleeperThread thread_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace waybar::modules
|