Vendor pkgs: add subflake directories

This commit is contained in:
2026-04-12 19:55:23 +02:00
parent ce5fafcf29
commit cb93e97ef5
33 changed files with 1885 additions and 3 deletions

View File

@@ -0,0 +1,46 @@
#ifndef CLIENT_H
#define CLIENT_H
#include <array>
#include <string>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
struct WorkspaceSignature {
public:
int id;
std::string name;
friend void from_json(const json& j, WorkspaceSignature& ws);
};
class Client {
public:
std::string address;
bool mapped;
bool hidden;
std::array<int, 2> size;
WorkspaceSignature workspace;
bool floating;
int monitor;
std::string className;
std::string title;
std::string initialClass;
std::string initialTitle;
int pid;
bool xwayland;
bool pinned;
int fullscreen;
int fullscreenClient;
bool overFullscreen;
std::string swallowing;
int focusHistory;
bool inhibitingIdle;
std::string xdgTag;
std::string xdgDescription;
friend void from_json(const json& j, Client& client);
};
#endif

View File

@@ -0,0 +1,17 @@
#ifndef FILE_SERVICE_H
#define FILE_SERVICE_H
#include <string>
#include <vector>
class FileService {
public:
static bool doesNonEmptyFileExist(std::string);
static void emptyFile(std::string);
static void createOrOverwriteFile(std::string, std::string);
static void appendToFile(std::string, std::string);
static void deleteNthLine(std::string, int);
static std::vector<std::string> readLines(std::string);
};
#endif

View File

@@ -0,0 +1,37 @@
#ifndef HYPRLAND_SERVICE_H
#define HYPRLAND_SERVICE_H
#include <list>
#include "Workspace.hpp"
#include "Client.hpp"
#include "WindowRule.hpp"
class HyprlandService {
private:
static std::string configFilePath;
static std::string getConfigFilePath();
static std::list<Workspace> getWorkspaces();
static std::optional<Workspace> getWorkspace(int);
static Workspace getCurrentWorkspace();
static std::list<Client> getClients();
static std::list<Client> getClientsOnActiveWorkspace();
static Client getActiveClient();
static bool isFloatingRulePresent(int);
static bool isFloatingRulePresent(Workspace);
static std::list<WindowRule> getWindowRules();
static std::optional<WindowRule> findConflictingRule(WindowRule);
static void setFloatingRule(bool);
static void removeRule(WindowRule);
static void setClientFloating(Client);
static void setClientTiled(Client);
public:
static void toggleFloating();
static void moveToWorkspace(int);
static void setConfigFilePath(std::string);
static WindowRule getActiveWorkspaceRule();
};
#endif

View File

@@ -0,0 +1,9 @@
#ifndef MACROS_H
#define MACROS_H
#define HYPRCTL_BINARY "hyprctl"
#define NULL_PATH "/dev/null"
#define ECHO_PATH "echo"
#define CAT_PATH "cat"
#endif

View File

@@ -0,0 +1,12 @@
#ifndef SHELL_SERVICE_H
#define SHELL_SERVICE_H
#include <string>
class ShellService {
public:
static std::string exec(const std::string& command);
static std::string getHomePath();
};
#endif

View File

@@ -0,0 +1,20 @@
#ifndef WINDOW_RULE_H
#define WINDOW_RULE_H
#include <string>
class WindowRule {
public:
//true -> tiling mode
//false -> floating mode
bool tile;
//Which workspace to apply to
int workspaceID;
std::string toString();
static WindowRule parse(std::string);
};
#endif

View File

@@ -0,0 +1,23 @@
#ifndef WORKSPACE_H
#define WORKSPACE_H
#include <string>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
class Workspace {
public:
int id;
std::string name;
std::string monitor;
int monitorID;
int windows;
bool hasfullscreen;
std::string lastwindow;
std::string lastwindowtitle;
bool ispersistent;
friend void from_json(const json& j, Workspace& workspace);
};
#endif