From ac3edec14b1b31942fb8dff3ba01a9b70990ced3 Mon Sep 17 00:00:00 2001 From: Yavor Kolev Date: Tue, 2 May 2023 06:51:52 -0700 Subject: Add `activeworkspace` hyprctl command (#2202) * Add `activeworkspace` hyprctl command * fix format in hyprctl * Make stuff more shared in workspace hyprctl --------- Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com> --- hyprctl/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hyprctl/main.cpp') 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")) -- cgit v1.2.3