Make lua source code string const

This commit is contained in:
Christopher Williams 2024-07-27 17:49:38 -04:00
parent 35bbfac000
commit 1d95508222
1 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,8 @@ AutoLuaKey::AutoLuaKey() {
lua.create_named_table("environments");
bind_lua_functions();
// TODO: Load scripts from a folder and bind this function for lua to call
register_lua_script("lua1", R"(
function main()
print('Hello from Lua! 1')
@ -41,7 +43,7 @@ void AutoLuaKey::bind_ydotool() {
int AutoLuaKey::lua_loop() {
// emit global lua function to execute
std::string lua_code = R"(
const std::string lua_code = R"(
function main()
for i = 1, 10 do
-- Execute each environment's main function