aboutsummaryrefslogtreecommitdiffhomepage
path: root/hyprctl
diff options
context:
space:
mode:
authorYavor Kolev <[email protected]>2023-05-02 06:51:52 -0700
committerGitHub <[email protected]>2023-05-02 14:51:52 +0100
commitac3edec14b1b31942fb8dff3ba01a9b70990ced3 (patch)
tree2403a5b84b672279057450fec6c6c5069882be7f /hyprctl
parentcde7f79af0d084cba585bb56f9302afab5a216f9 (diff)
downloadHyprland-ac3edec14b1b31942fb8dff3ba01a9b70990ced3.tar.gz
Hyprland-ac3edec14b1b31942fb8dff3ba01a9b70990ced3.zip
Add `activeworkspace` hyprctl command (#2202)
* Add `activeworkspace` hyprctl command * fix format in hyprctl * Make stuff more shared in workspace hyprctl --------- Co-authored-by: vaxerski <[email protected]>
Diffstat (limited to 'hyprctl')
-rw-r--r--hyprctl/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp
index 2f7ab2b9..31efcd16 100644
--- a/hyprctl/main.cpp
+++ b/hyprctl/main.cpp
@@ -23,6 +23,7 @@ const std::string USAGE = R"#(usage: hyprctl [(opt)flags] [command] [(opt)args]
commands:
monitors
workspaces
+ activeworkspace
clients
activewindow
layers
@@ -50,7 +51,9 @@ flags:
--batch -> execute a batch of commands, separated by ';'
)#";
-void request(std::string arg, int minArgs = 0) {
+#define PAD
+
+void request(std::string arg, int minArgs = 0) {
const auto SERVERSOCKET = socket(AF_UNIX, SOCK_STREAM, 0);
const auto ARGS = std::count(arg.begin(), arg.end(), ' ');
@@ -327,6 +330,8 @@ int main(int argc, char** argv) {
request(fullRequest);
else if (fullRequest.contains("/workspaces"))
request(fullRequest);
+ else if (fullRequest.contains("/activeworkspace"))
+ request(fullRequest);
else if (fullRequest.contains("/activewindow"))
request(fullRequest);
else if (fullRequest.contains("/layers"))