summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.hpp
blob: 339acd1bb6147c6277783978b8d5d0b8d92ac97d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "../Compositor.hpp"
#include <fstream>
#include "../helpers/MiscFunctions.hpp"
#include <functional>

class CHyprCtl {
  public:
    CHyprCtl();

    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);

    int                              m_iSocketFD = -1;

  private:
    void                                          startHyprCtlSocket();

    std::vector<std::shared_ptr<SHyprCtlCommand>> m_vCommands;
};

inline std::unique_ptr<CHyprCtl> g_pHyprCtl;