diff options
author | vaxerski <[email protected]> | 2022-04-21 16:56:27 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-04-21 16:56:27 +0200 |
commit | 07080498fd050a6a6660eb68c36d12eb3f87a003 (patch) | |
tree | fe1c8949b78bce5f97a4e96fd3ec3e277e3d50d7 /hyprctl | |
parent | b618fc1caa4063bbed8373935db7e00b2f0cc9fe (diff) | |
download | Hyprland-07080498fd050a6a6660eb68c36d12eb3f87a003.tar.gz Hyprland-07080498fd050a6a6660eb68c36d12eb3f87a003.zip |
Added hyprctl keyword
Diffstat (limited to 'hyprctl')
-rw-r--r-- | hyprctl/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 0382901a..7fe745da 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -23,6 +23,7 @@ usage: hyprctl [command] [(opt)args] activewindow layers dispatch + keyword )#"; void request(std::string arg) { @@ -109,6 +110,17 @@ void dispatchRequest(int argc, char** argv) { request(rq); } +void keywordRequest(int argc, char** argv) { + if (argc < 4) { + std::cout << "keyword requires 2 params"; + return; + } + + std::string rq = "keyword " + std::string(argv[2]) + " " + std::string(argv[3]); + + request(rq); +} + int main(int argc, char** argv) { int bflag = 0, sflag = 0, index, c; @@ -123,6 +135,7 @@ int main(int argc, char** argv) { else if (!strcmp(argv[1], "activewindow")) request("activewindow"); else if (!strcmp(argv[1], "layers")) request("layers"); else if (!strcmp(argv[1], "dispatch")) dispatchRequest(argc, argv); + else if (!strcmp(argv[1], "keyword")) keywordRequest(argc, argv); else { printf(USAGE.c_str()); return 1; |