summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-22 18:14:25 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-22 18:14:25 +0200
commite3b19e01319bdda7f3f5799f53e28dade0bd1265 (patch)
treeeece4dd152756c5ce2d3b62662f9133640c371e8 /src/debug/HyprCtl.cpp
parent94811485c9e50eb310d8abf19ab60ea01fc3860d (diff)
Added hyprctl version
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 123f3ceb..cb48b4d7 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -71,6 +71,22 @@ std::string layersRequest() {
return result;
}
+std::string versionRequest() {
+ std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + ", flags: (if any)\n";
+
+#ifdef LEGACY_RENDERER
+ result += "legacyrenderer\n";
+#endif
+#ifndef NDEBUG
+ result += "debug\n";
+#endif
+#ifdef NO_XWAYLAND
+ result += "no xwayland\n";
+#endif
+
+ return result;
+}
+
std::string dispatchRequest(std::string in) {
// get rid of the dispatch keyword
in = in.substr(in.find_first_of(' ') + 1);
@@ -131,6 +147,8 @@ void HyprCtl::tickHyprCtl() {
reply = activeWindowRequest();
else if (request == "layers")
reply = layersRequest();
+ else if (request == "version")
+ reply = versionRequest();
else if (request.find("dispatch") == 0)
reply = dispatchRequest(request);
else if (request.find("keyword") == 0)