diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f8011a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.session diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..5dc4338 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,10 @@ +{ + "workspace": { + "library": [ + "/nix/store/k1jc5h9ls6j600hcpjciqn0s29whas63-hyprland-0.55.0+date=2026-05-11_5e441ca/share/hypr/stubs/hl.meta.lua" + ] + }, + "diagnostics": { + "globals": ["hl"] + } +} diff --git a/hyprland.lua b/hyprland.lua index e69de29..98fbc8a 100644 --- a/hyprland.lua +++ b/hyprland.lua @@ -0,0 +1 @@ +require("modules") diff --git a/modules.lua b/modules.lua new file mode 100644 index 0000000..8bab8f7 --- /dev/null +++ b/modules.lua @@ -0,0 +1,28 @@ +-- loader.lua +local function get_modules() + local modules = {} + + -- -1: list one file per line + -- ../modules/*.lua: target sibling directory + local cmd = "ls -1 ../modules/*.lua 2>/dev/null" + + local p = io.popen(cmd) + if not p then + return modules + end + + for path in p:lines() do + -- Extract the filename between the last '/' and the '.lua' + local name = path:match("([^/]+)%.lua$") + if name then + table.insert(modules, name) + end + end + + p:close() + return modules +end + +-- Return the result of the function so require("loader") +-- gives you the table immediately. +return get_modules() diff --git a/modules/binds.lua b/modules/binds.lua new file mode 100644 index 0000000..20ad9aa --- /dev/null +++ b/modules/binds.lua @@ -0,0 +1,8 @@ +local mainMod = "SUPER + " +local binds = { + { key = "x", dispatch = "kitty" }, +} + +for _, bind in ipairs(binds) do + hl.bind(mainMod .. bind.key, hl.dsp.exec_cmd(bind.dispatch)) +end diff --git a/modules/startup.lua b/modules/startup.lua new file mode 100644 index 0000000..156555e --- /dev/null +++ b/modules/startup.lua @@ -0,0 +1,4 @@ +hl.on("hyprland.start", function() + hl.exec_cmd("waybar") + hl.exec_cmd("dunst") +end)