Files
Waybar/include/modules/sway/scratchpad.hpp
T

35 lines
758 B
C++
Raw Normal View History

2022-08-29 04:55:48 +08:00
#pragma once
#include <gtkmm/label.h>
#include <mutex>
#include <string>
#include "ALabel.hpp"
#include "bar.hpp"
#include "client.hpp"
#include "modules/sway/ipc/client.hpp"
#include "util/json.hpp"
namespace waybar::modules::sway {
class Scratchpad : public ALabel {
public:
2022-08-31 01:54:19 +08:00
Scratchpad(const std::string&, const Json::Value&);
2022-08-29 04:55:48 +08:00
~Scratchpad() = default;
auto update() -> void;
private:
auto getTree() -> void;
auto onCmd(const struct Ipc::ipc_response&) -> void;
auto onEvent(const struct Ipc::ipc_response&) -> void;
2022-08-31 01:54:19 +08:00
std::string tooltip_format_;
bool show_empty_;
bool tooltip_enabled_;
std::string tooltip_text_;
2022-08-29 04:55:48 +08:00
int count_;
2022-08-31 01:54:19 +08:00
std::mutex mutex_;
2022-08-29 04:55:48 +08:00
Ipc ipc_;
util::JsonParser parser_;
};
} // namespace waybar::modules::sway