Vendor pkgs: add subflake directories
This commit is contained in:
46
pkgs/hyprland-toggle-tiling/include/Client.hpp
Normal file
46
pkgs/hyprland-toggle-tiling/include/Client.hpp
Normal 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
|
||||
17
pkgs/hyprland-toggle-tiling/include/FileService.hpp
Normal file
17
pkgs/hyprland-toggle-tiling/include/FileService.hpp
Normal 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
|
||||
37
pkgs/hyprland-toggle-tiling/include/HyprlandService.hpp
Normal file
37
pkgs/hyprland-toggle-tiling/include/HyprlandService.hpp
Normal 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
|
||||
9
pkgs/hyprland-toggle-tiling/include/Macros.hpp
Normal file
9
pkgs/hyprland-toggle-tiling/include/Macros.hpp
Normal 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
|
||||
12
pkgs/hyprland-toggle-tiling/include/ShellService.hpp
Normal file
12
pkgs/hyprland-toggle-tiling/include/ShellService.hpp
Normal 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
|
||||
20
pkgs/hyprland-toggle-tiling/include/WindowRule.hpp
Normal file
20
pkgs/hyprland-toggle-tiling/include/WindowRule.hpp
Normal 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
|
||||
23
pkgs/hyprland-toggle-tiling/include/Workspace.hpp
Normal file
23
pkgs/hyprland-toggle-tiling/include/Workspace.hpp
Normal 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
|
||||
Reference in New Issue
Block a user