2022-03-20 16:51:14 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../Compositor.hpp"
|
|
|
|
#include <fstream>
|
2022-04-04 19:44:25 +02:00
|
|
|
#include "../helpers/MiscFunctions.hpp"
|
2024-02-05 02:43:45 +01:00
|
|
|
#include <functional>
|
2022-03-20 16:51:14 +01:00
|
|
|
|
2024-02-05 02:43:45 +01:00
|
|
|
class CHyprCtl {
|
|
|
|
public:
|
|
|
|
CHyprCtl();
|
2022-08-28 11:19:08 +02:00
|
|
|
|
2024-05-05 18:16:00 +02:00
|
|
|
std::string makeDynamicCall(const std::string& input);
|
|
|
|
SP<SHyprCtlCommand> registerCommand(SHyprCtlCommand cmd);
|
|
|
|
void unregisterCommand(const SP<SHyprCtlCommand>& cmd);
|
|
|
|
std::string getReply(std::string);
|
2024-02-05 02:43:45 +01:00
|
|
|
|
2024-05-05 18:16:00 +02:00
|
|
|
int m_iSocketFD = -1;
|
2024-02-05 02:43:45 +01:00
|
|
|
|
2024-03-08 18:47:12 +01:00
|
|
|
struct {
|
2024-03-09 04:09:25 +01:00
|
|
|
bool all = false;
|
2024-03-08 18:47:12 +01:00
|
|
|
} m_sCurrentRequestParams;
|
|
|
|
|
2024-02-05 02:43:45 +01:00
|
|
|
private:
|
2024-05-05 18:16:00 +02:00
|
|
|
void startHyprCtlSocket();
|
2024-02-05 02:43:45 +01:00
|
|
|
|
2024-05-05 18:16:00 +02:00
|
|
|
std::vector<SP<SHyprCtlCommand>> m_vCommands;
|
2024-02-05 02:43:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CHyprCtl> g_pHyprCtl;
|