add hyprland socket support

This commit is contained in:
2025-12-09 00:09:14 +01:00
parent de6ece13fa
commit 2570445aef
9 changed files with 227 additions and 33 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <glibmm.h>
#include <sigc++/sigc++.h>
#include <string>
class HyprlandService
{
public:
HyprlandService();
~HyprlandService();
// Setup the connection
void start();
// Signal that emits (EventName, EventData)
// Example: emits ("workspace", "1")
sigc::signal<void(std::string, std::string)> on_event;
void on_hyprland_event(std::string event, std::string data);
private:
int m_fd = -1; // File descriptor for the socket
std::string m_buffer; // Buffer to handle partial socket reads
bool on_socket_read(Glib::IOCondition condition);
void parse_message(const std::string &line);
std::string get_socket_path();
};