diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-08-17 17:33:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-17 17:33:16 +0100 |
| commit | 92744b5b9aa386257bf243c957ab64f7f4171a19 (patch) | |
| tree | 0caa6fdf3ca91c81e89ef21ddac3c6ecf6794b1b /src/debug/HyprCtl.cpp | |
| parent | c5feee1e357f3c3c59ebe406630601c627807963 (diff) | |
IPC: Add config descriptions (#7377)
Thanks @gulafaran for the work
---
Co-authored-by: @gulafaran
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 3ab0fa7a..717fb5c0 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1561,6 +1561,21 @@ std::string getIsLocked(eHyprCtlOutputFormat format, std::string request) { return lockedStr; } +std::string getDescriptions(eHyprCtlOutputFormat format, std::string request) { + std::string json = "{"; + const auto& DESCS = g_pConfigManager->getAllDescriptions(); + + for (const auto& d : DESCS) { + json += d.jsonify() + ",\n"; + } + + json.pop_back(); + json.pop_back(); + + json += "}\n"; + return json; +} + CHyprCtl::CHyprCtl() { registerCommand(SHyprCtlCommand{"workspaces", true, workspacesRequest}); registerCommand(SHyprCtlCommand{"workspacerules", true, workspaceRulesRequest}); @@ -1581,6 +1596,7 @@ CHyprCtl::CHyprCtl() { registerCommand(SHyprCtlCommand{"layouts", true, layoutsRequest}); registerCommand(SHyprCtlCommand{"configerrors", true, configErrorsRequest}); registerCommand(SHyprCtlCommand{"locked", true, getIsLocked}); + registerCommand(SHyprCtlCommand{"descriptions", true, getDescriptions}); registerCommand(SHyprCtlCommand{"monitors", false, monitorsRequest}); registerCommand(SHyprCtlCommand{"reload", false, reloadRequest}); |
