diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-02-05 01:56:38 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-02-05 01:57:29 +0000 |
| commit | 60bda7ee3d0a77d19277540cce53ecbddeabd716 (patch) | |
| tree | 813a2342a3e56c174b5bee91bf274bc6081ef56c /src/debug/HyprCtl.hpp | |
| parent | 939696f97e2dcfa9ed6b91aa7ddf608c454d49e5 (diff) | |
pluginapi: allow registering hyprctl commands
closes #4616
Diffstat (limited to 'src/debug/HyprCtl.hpp')
| -rw-r--r-- | src/debug/HyprCtl.hpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/debug/HyprCtl.hpp b/src/debug/HyprCtl.hpp index 1bef65a0..339acd1b 100644 --- a/src/debug/HyprCtl.hpp +++ b/src/debug/HyprCtl.hpp @@ -9,28 +9,17 @@ class CHyprCtl { public: CHyprCtl(); - enum eHyprCtlOutputFormat { - FORMAT_NORMAL = 0, - FORMAT_JSON - }; + std::string makeDynamicCall(const std::string& input); + std::shared_ptr<SHyprCtlCommand> registerCommand(SHyprCtlCommand cmd); + void unregisterCommand(const std::shared_ptr<SHyprCtlCommand>& cmd); + std::string getReply(std::string); - struct SCommand { - std::string name = ""; - bool exact = true; - std::function<std::string(eHyprCtlOutputFormat, std::string)> fn; - }; - - std::string makeDynamicCall(const std::string& input); - std::shared_ptr<SCommand> registerCommand(SCommand cmd); - void unregisterCommand(const std::shared_ptr<SCommand>& cmd); - std::string getReply(std::string); - - int m_iSocketFD = -1; + int m_iSocketFD = -1; private: - void startHyprCtlSocket(); + void startHyprCtlSocket(); - std::vector<std::shared_ptr<SCommand>> m_vCommands; + std::vector<std::shared_ptr<SHyprCtlCommand>> m_vCommands; }; inline std::unique_ptr<CHyprCtl> g_pHyprCtl;
\ No newline at end of file |
