From c8b4606f534c60dbbf3e04056fb02120d39f8540 Mon Sep 17 00:00:00 2001 From: Harrison DiAmbrosio Date: Thu, 27 Nov 2025 00:23:00 -0500 Subject: [PATCH] what is this stupid test i added, im going to bed --- build.zig | 1 - runtime/share/mezzaluna/init.lua | 54 +++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index a48cffe..a326c6d 100644 --- a/build.zig +++ b/build.zig @@ -93,5 +93,4 @@ pub fn build(b: *std.Build) void { const run_cmd = b.addRunArtifact(mez); run_step.dependOn(&run_cmd.step); run_cmd.step.dependOn(b.getInstallStep()); - run_cmd.addArg("alacritty"); } diff --git a/runtime/share/mezzaluna/init.lua b/runtime/share/mezzaluna/init.lua index 5df6e30..40faff2 100644 --- a/runtime/share/mezzaluna/init.lua +++ b/runtime/share/mezzaluna/init.lua @@ -10,6 +10,58 @@ end mez.path.config = mez.fs.joinpath(env_conf, "mez", "init.lua") package.path = package.path..";"..mez.fs.joinpath(env_conf, "mez", "lua", "?.lua") +local test = function() + -- View tests + mez.api.spawn("alacritty") + local focused_view = mez.view.get_focused_id() + print(focused_view) + + for i = 0,4 do + mez.api.spawn("alacritty") + end + + local view_ids = mez.view.get_all_ids() + for _, id in ipairs(view_ids) do + print(id) + mez.view.close(id) + end + + print(mez.view.get_title(0)) + print(mez.view.get_title(focused_view)) + print(mez.view.get_app_id(0)) + print(mez.view.get_app_id(focused_view)) + + mez.view.set_position(0, 100, 100) + mez.view.set_position(focused_view, 200, 200) + mez.view.set_size(0, 100, 100) + mez.view.set_size(focused_view, 200, 200) + + -- Output tests + local focused_output = mez.output.get_focused_id(); + print(focused_output) + + local output_ids = mez.output.get_all_ids() + for _, id in ipairs(output_ids) do + print(id) + end + + print(mez.output.get_name(0)) + print(mez.output.get_name(focused_output)) + print(mez.output.get_description(0)) + print(mez.output.get_description(focused_output)) + print(mez.output.get_model(0)) + print(mez.output.get_model(focused_output)) + print(mez.output.get_make(0)) + print(mez.output.get_make(focused_output)) + print(mez.output.get_serial(0)) + print(mez.output.get_serial(focused_output)) + print(mez.output.get_rate(0)) + print(mez.output.get_rate(focused_output)) + + local res = mez.output.get_resolution(0) + print(res.width .. ", " .. res.height) +end + mez.input.add_keymap("alt", "Return", { press = function() -- foot doesnt resize on uneven columns @@ -68,7 +120,7 @@ local tiler = function () end mez.input.add_keymap("alt", "t", { - press = function() tiler() end + press = function() test() end }) mez.hook.add("ViewMapPre", {