waybar/include/modules/image.hpp

37 lines
624 B
C++
Raw Normal View History

#pragma once
#include <fmt/format.h>
#include <gtkmm/image.h>
#include <csignal>
#include <string>
#include "ALabel.hpp"
2023-01-24 20:34:02 +01:00
#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:
2023-01-24 20:34:02 +01:00
Image(const std::string&, const Json::Value&);
auto update() -> void;
void refresh(int /*signal*/);
private:
void delayWorker();
void handleEvent();
2023-01-24 20:34:02 +01:00
Gtk::Box box_;
2023-01-04 16:26:50 +01:00
Gtk::Image image_;
std::string path_;
2023-01-04 16:26:50 +01:00
int size_;
int interval_;
util::SleeperThread thread_;
};
} // namespace waybar::modules