mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
38 lines
672 B
C++
38 lines
672 B
C++
#pragma once
|
|
|
|
#include <fmt/format.h>
|
|
#include <gtkmm/image.h>
|
|
|
|
#include <csignal>
|
|
#include <string>
|
|
|
|
#include "ALabel.hpp"
|
|
#include "gtkmm/box.h"
|
|
#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 Json::Value&);
|
|
virtual ~Image() = default;
|
|
auto update() -> void override;
|
|
void refresh(int /*signal*/) override;
|
|
|
|
private:
|
|
void delayWorker();
|
|
void handleEvent();
|
|
|
|
Gtk::Box box_;
|
|
Gtk::Image image_;
|
|
std::string path_;
|
|
int size_;
|
|
int interval_;
|
|
|
|
util::SleeperThread thread_;
|
|
};
|
|
|
|
} // namespace waybar::modules
|