feat(sway/scratchpad): add basic counter

This commit is contained in:
asas1asas200
2022-08-29 04:55:48 +08:00
parent ce10ce0d5e
commit e3342467fc
5 changed files with 92 additions and 1 deletions

View File

@ -0,0 +1,34 @@
#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 AModule, public sigc::trackable {
class Scratchpad : public ALabel {
public:
Scratchpad(const std::string&, const waybar::Bar&, const Json::Value&);
~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;
// bool handleScroll(GdkEventScroll*);
Gtk::Box box_;
const Bar& bar_;
std::mutex mutex_;
int count_;
Ipc ipc_;
util::JsonParser parser_;
};
} // namespace waybar::modules::sway