From e3b19e01319bdda7f3f5799f53e28dade0bd1265 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 22 Apr 2022 18:14:25 +0200 Subject: Added hyprctl version --- src/debug/HyprCtl.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/debug/HyprCtl.cpp') 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) -- cgit v1.2.3