Start extracting omarchy helpers for cumbersome lua calls

This commit is contained in:
David Heinemeier Hansson
2026-05-14 11:13:37 +02:00
parent b26cd62334
commit 72bd02ca89
8 changed files with 222 additions and 188 deletions
+33
View File
@@ -0,0 +1,33 @@
-- Shared helpers for Hyprland Lua configuration.
o = o or {}
local function shell_quote(value)
return "'" .. tostring(value):gsub("'", "'\\''") .. "'"
end
function o.bind(keys, description, dispatcher, options)
local opts = options or {}
if description then
opts.description = description
end
if type(dispatcher) == "string" then
dispatcher = hl.dsp.exec_cmd(dispatcher)
end
hl.bind(keys, dispatcher, opts)
end
function o.launch(command)
return "uwsm-app -- " .. command
end
function o.launch_webapp(url)
return "omarchy-launch-webapp " .. shell_quote(url)
end
function o.launch_webapp_sole(name, url)
return "omarchy-launch-or-focus-webapp " .. shell_quote(name) .. " " .. shell_quote(url)
end