Files
Waybar/include/modules/hyprland/submap.hpp
T

37 lines
758 B
C++
Raw Normal View History

2023-09-02 15:22:26 -05:00
#pragma once
2022-12-21 01:45:57 +01:00
#include <fmt/format.h>
2023-01-04 16:26:50 +01:00
2023-09-02 15:22:26 -05:00
#include <string>
2022-12-21 01:45:57 +01:00
#include "ALabel.hpp"
#include "bar.hpp"
#include "modules/hyprland/backend.hpp"
#include "util/json.hpp"
namespace waybar::modules::hyprland {
class Submap : public waybar::ALabel, public EventHandler {
public:
Submap(const std::string&, const waybar::Bar&, const Json::Value&);
2024-02-25 12:11:22 +01:00
~Submap() override;
2022-12-21 01:45:57 +01:00
2023-03-02 16:57:07 +03:00
auto update() -> void override;
2022-12-21 01:45:57 +01:00
private:
2024-02-13 12:53:45 +01:00
auto parseConfig(const Json::Value&) -> void;
2024-02-25 12:11:22 +01:00
void onEvent(const std::string& ev) override;
2022-12-21 01:45:57 +01:00
std::mutex mutex_;
const Bar& bar_;
util::JsonParser parser_;
std::string submap_;
std::string prev_submap_;
2024-02-13 12:53:45 +01:00
bool always_on_ = false;
std::string default_submap_ = "Default";
2025-02-19 00:58:08 +01:00
IPC& m_ipc;
2022-12-21 01:45:57 +01:00
};
} // namespace waybar::modules::hyprland