IPC: Add config descriptions (#7377)

Thanks @gulafaran for the work

---

Co-authored-by: @gulafaran
This commit is contained in:
Vaxry 2024-08-17 17:33:16 +01:00 committed by GitHub
parent c5feee1e35
commit 92744b5b9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 1491 additions and 13 deletions

View file

@ -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});