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>
This commit is contained in:
Yavor Kolev
2023-05-02 06:51:52 -07:00
committed by GitHub
parent cde7f79af0
commit ac3edec14b
2 changed files with 43 additions and 27 deletions

View File

@@ -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"))