Files
Waybar/include/modules/image.hpp
T

41 lines
773 B
C++
Raw Normal View History

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"
2023-01-24 14:34:02 -05:00
#include "gtkmm/box.h"
2022-01-16 23:55:13 +00:00
#include "util/command.hpp"
#include "util/json.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class Image : public AModule {
public:
2023-01-24 14:34:02 -05:00
Image(const std::string&, const Json::Value&);
2023-03-02 16:57:07 +03:00
virtual ~Image() = default;
auto update() -> void override;
void refresh(int /*signal*/) override;
2022-01-16 23:55:13 +00:00
private:
void delayWorker();
void handleEvent();
2023-04-21 16:38:21 +08:00
void parseOutputRaw();
2022-01-16 23:55:13 +00:00
2023-01-24 14:34:02 -05:00
Gtk::Box box_;
2023-01-04 16:26:50 +01:00
Gtk::Image image_;
2022-01-16 23:55:13 +00:00
std::string path_;
2023-04-21 16:38:21 +08:00
std::string tooltip_;
2023-01-04 16:26:50 +01:00
int size_;
2025-08-16 15:34:43 -07:00
std::chrono::milliseconds interval_;
2023-04-21 16:38:21 +08:00
util::command::res output_;
2022-01-16 23:55:13 +00:00
util::SleeperThread thread_;
};
} // namespace waybar::modules