From cca3c6430104836bdf5c060949a13b6b80ff0219 Mon Sep 17 00:00:00 2001 From: Alessio Molinari Date: Mon, 12 Feb 2024 11:34:21 +0100 Subject: [PATCH] hyprctl: remove hardcoded hyprctl commands. (#4671) * fix: remove hardcoded hyprctl commands. This allows plugin to properly register hyprctl commands. * fix: restore commands with min args --- hyprctl/main.cpp | 47 +++-------------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 281a74ac..b1d89a8a 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -371,44 +371,8 @@ int main(int argc, char** argv) { if (fullRequest.contains("/--batch")) batchRequest(fullRequest); - else if (fullRequest.contains("/monitors")) - request(fullRequest); - else if (fullRequest.contains("/clients")) - request(fullRequest); - else if (fullRequest.contains("/workspaces")) - request(fullRequest); - else if (fullRequest.contains("/activeworkspace")) - request(fullRequest); - else if (fullRequest.contains("/workspacerules")) - request(fullRequest); - else if (fullRequest.contains("/activewindow")) - request(fullRequest); - else if (fullRequest.contains("/layers")) - request(fullRequest); - else if (fullRequest.contains("/version")) - request(fullRequest); - else if (fullRequest.contains("/kill")) - request(fullRequest); - else if (fullRequest.contains("/systeminfo")) - request(fullRequest); - else if (fullRequest.contains("/splash")) - request(fullRequest); - else if (fullRequest.contains("/devices")) - request(fullRequest); - else if (fullRequest.contains("/reload")) - request(fullRequest); - else if (fullRequest.contains("/getoption")) - request(fullRequest); - else if (fullRequest.contains("/binds")) - request(fullRequest); - else if (fullRequest.contains("/cursorpos")) - request(fullRequest); - else if (fullRequest.contains("/animations")) - request(fullRequest); - else if (fullRequest.contains("/globalshortcuts")) - request(fullRequest); - else if (fullRequest.contains("/rollinglog")) - request(fullRequest); + else if (fullRequest.contains("/hyprpaper")) + requestHyprpaper(fullRequest); else if (fullRequest.contains("/switchxkblayout")) request(fullRequest, 2); else if (fullRequest.contains("/seterror")) @@ -429,15 +393,10 @@ int main(int argc, char** argv) { request(fullRequest, 2); else if (fullRequest.contains("/decorations")) request(fullRequest, 1); - else if (fullRequest.contains("/hyprpaper")) - requestHyprpaper(fullRequest); - else if (fullRequest.contains("/layouts")) - request(fullRequest); else if (fullRequest.contains("/--help")) printf("%s", USAGE.c_str()); else { - printf("%s\n", USAGE.c_str()); - return 1; + request(fullRequest); } printf("\n");