Re-add kwin and hyprland helper to get window title, this time without a thread

This commit is contained in:
dec05eba
2026-04-27 00:04:29 +02:00
parent 57c60b6aee
commit 71d7477aea
15 changed files with 318 additions and 187 deletions

View File

@@ -0,0 +1,30 @@
#pragma once
#include "DesktopEnvironment.hpp"
#include <sys/types.h>
#include <stdio.h>
namespace gsr {
class DesktopEnvironmentHyprland : public DesktopEnvironment {
public:
DesktopEnvironmentHyprland() = default;
DesktopEnvironmentHyprland(const DesktopEnvironmentHyprland&) = delete;
DesktopEnvironmentHyprland& operator=(const DesktopEnvironmentHyprland&) = delete;
~DesktopEnvironmentHyprland();
bool start() override;
void update() override;
std::string get_focused_window_title() override;
//std::string get_focused_monitor_name() override;
private:
void shutdown();
private:
pid_t process_id = -1;
FILE *stdout_file = nullptr;
int read_fd = -1;
char line_buffer[1024];
std::string line;
std::string window_title;
};
}