From f719bd67949aa92ad5a9b5dc0659cda8804ee39c Mon Sep 17 00:00:00 2001 From: Dregu Date: Sat, 13 Jun 2026 19:18:20 +0300 Subject: [PATCH] hyprctl: add interactive Lua REPL mode (#15043) * hyprctl: add lua repl and return for eval * hook print function for repl * add help * nix fixes this * on second thought don't break all tests * tests --- hyprctl/CMakeLists.txt | 2 +- hyprctl/src/Strings.hpp | 3 ++ hyprctl/src/main.cpp | 24 ++++++++- hyprtester/src/tests/main/hyprctl.cpp | 5 ++ nix/default.nix | 2 + src/config/lua/ConfigManager.cpp | 72 ++++++++++++++++++++++++--- src/config/lua/ConfigManager.hpp | 6 ++- src/debug/HyprCtl.cpp | 4 +- 8 files changed, 105 insertions(+), 13 deletions(-) diff --git a/hyprctl/CMakeLists.txt b/hyprctl/CMakeLists.txt index 1a888cabb..57746de4f 100644 --- a/hyprctl/CMakeLists.txt +++ b/hyprctl/CMakeLists.txt @@ -5,7 +5,7 @@ project( DESCRIPTION "Control utility for Hyprland" ) -pkg_check_modules(hyprctl_deps REQUIRED IMPORTED_TARGET hyprutils>=0.2.4 hyprwire re2) +pkg_check_modules(hyprctl_deps REQUIRED IMPORTED_TARGET hyprutils>=0.2.4 hyprwire re2 readline) file(GLOB_RECURSE HYPRCTL_SRCFILES CONFIGURE_DEPENDS "src/*.cpp" "hw-protocols/*.cpp" "include/*.hpp") diff --git a/hyprctl/src/Strings.hpp b/hyprctl/src/Strings.hpp index 421c4c18e..69bdd470b 100644 --- a/hyprctl/src/Strings.hpp +++ b/hyprctl/src/Strings.hpp @@ -19,6 +19,7 @@ commands: dismissnotify [amount] → Dismisses all or up to AMOUNT notifications dispatch [args] → Issue a dispatch to call a keybind dispatcher with arguments + eval → Issue a Lua string to execute getoption