add basic workspace parsing

This commit is contained in:
2025-12-09 17:07:01 +01:00
parent cd3a9e6503
commit fb64f542a9
3 changed files with 109 additions and 12 deletions

View File

@@ -1,11 +1,30 @@
#pragma once
#include <glibmm.h>
#include <map>
#include <sigc++/sigc++.h>
#include <string>
class HyprlandService
{
typedef struct WorkspaceState
{
int id;
bool active;
bool focused;
bool urgent;
} WorkspaceState;
typedef struct Monitor
{
std::map<int, WorkspaceState> workspaceStates;
std::string name;
int x;
int y;
int id;
int focusedWorkspaceId;
} Monitor;
public:
HyprlandService();
~HyprlandService();
@@ -18,6 +37,7 @@ class HyprlandService
private:
int m_fd = -1;
std::string m_buffer;
std::map<int, Monitor> monitors;
bool on_socket_read(Glib::IOCondition condition);
void parse_message(const std::string &line);