summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/shared.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'hyprtester/src/tests/shared.hpp')
-rw-r--r--hyprtester/src/tests/shared.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/hyprtester/src/tests/shared.hpp b/hyprtester/src/tests/shared.hpp
index 95058e04..fbef8a0e 100644
--- a/hyprtester/src/tests/shared.hpp
+++ b/hyprtester/src/tests/shared.hpp
@@ -19,5 +19,11 @@ namespace Tests {
bool killAllLayers();
std::string execAndGet(const std::string& cmd);
bool writeFile(const std::string& name, const std::string& contents);
- std::string getWindowAttribute(const std::string& winInfo, const std::string& attr);
+ /**
+ * Extracts the given attribute from Hyprland's response to requests such as `/clients`, `/workspaces`, etc.
+ * Automatically appends `: ` to `attr`.
+ *
+ * For example, `Tests::getAttribute(getFromSocket("/activewindow"), "at")` returns the active window's coordinates, e.g., `"2,32"`
+ */
+ std::string getAttribute(const std::string& hyprlandResponse, std::string attr);
};