Merge branch 'master' into master

This commit is contained in:
herlev
2022-10-17 09:44:17 +02:00
committed by GitHub
54 changed files with 887 additions and 391 deletions

View File

@ -1,30 +1,28 @@
#pragma once
#include <string>
#include <memory>
#include <mutex>
#include <deque>
#include <functional>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
namespace waybar::modules::hyprland {
class IPC {
public:
public:
IPC() { startIPC(); }
void registerForIPC(const std::string&, std::function<void(const std::string&)>);
std::string getSocket1Reply(const std::string& rq);
private:
private:
void startIPC();
void parseIPC(const std::string&);
void startIPC();
void parseIPC(const std::string&);
std::mutex callbackMutex;
std::deque<std::pair<std::string, std::function<void(const std::string&)>>> callbacks;
std::mutex callbackMutex;
std::deque<std::pair<std::string, std::function<void(const std::string&)>>> callbacks;
};
inline std::unique_ptr<IPC> gIPC;
inline bool modulesReady = false;
};
}; // namespace waybar::modules::hyprland

View File

@ -1,20 +1,20 @@
#include <fmt/format.h>
#include "ALabel.hpp"
#include "AButton.hpp"
#include "bar.hpp"
#include "modules/hyprland/backend.hpp"
#include "util/json.hpp"
namespace waybar::modules::hyprland {
class Language : public waybar::ALabel {
public:
class Language : public waybar::AButton {
public:
Language(const std::string&, const waybar::Bar&, const Json::Value&);
~Language() = default;
auto update() -> void;
private:
private:
void onEvent(const std::string&);
void initLanguage();
@ -26,4 +26,4 @@ private:
std::string layoutName_;
};
}
} // namespace waybar::modules::hyprland

View File

@ -10,13 +10,13 @@
namespace waybar::modules::hyprland {
class Window : public waybar::ALabel {
public:
public:
Window(const std::string&, const waybar::Bar&, const Json::Value&);
~Window() = default;
auto update() -> void;
private:
private:
uint getActiveWorkspaceID(std::string);
std::string getLastWindowTitle(uint);
void onEvent(const std::string&);
@ -28,4 +28,4 @@ private:
std::string lastView;
};
}
} // namespace waybar::modules::hyprland