mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 04:37:49 +02:00
34 lines
733 B
Lua
34 lines
733 B
Lua
-- 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
|