2018-10-30 12:39:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2019-04-18 15:52:00 +00:00
|
|
|
#include "ALabel.hpp"
|
2018-10-30 12:39:30 +00:00
|
|
|
#include "bar.hpp"
|
|
|
|
#include "client.hpp"
|
|
|
|
#include "modules/sway/ipc/client.hpp"
|
2019-05-07 11:43:48 +00:00
|
|
|
#include "util/json.hpp"
|
2018-10-30 12:39:30 +00:00
|
|
|
|
|
|
|
namespace waybar::modules::sway {
|
|
|
|
|
2019-05-13 13:15:50 +00:00
|
|
|
class Mode : public ALabel, public sigc::trackable {
|
2019-04-18 15:52:00 +00:00
|
|
|
public:
|
2019-05-07 11:21:18 +00:00
|
|
|
Mode(const std::string&, const Json::Value&);
|
2019-04-18 15:52:00 +00:00
|
|
|
~Mode() = default;
|
|
|
|
auto update() -> void;
|
|
|
|
|
|
|
|
private:
|
2019-04-24 10:37:24 +00:00
|
|
|
void onEvent(const struct Ipc::ipc_response&);
|
2019-04-18 15:52:00 +00:00
|
|
|
|
2019-05-29 15:53:22 +00:00
|
|
|
std::string mode_;
|
2019-05-07 11:43:48 +00:00
|
|
|
util::JsonParser parser_;
|
2019-06-17 09:39:45 +00:00
|
|
|
std::mutex mutex_;
|
2019-08-28 02:43:03 +00:00
|
|
|
Ipc ipc_;
|
2018-10-30 12:39:30 +00:00
|
|
|
};
|
|
|
|
|
2019-05-25 15:50:45 +00:00
|
|
|
} // namespace waybar::modules::sway
|