style: re-format

This commit is contained in:
2026-06-12 17:12:25 -04:00
parent a0b22453eb
commit e298b55cb7
36 changed files with 832 additions and 832 deletions
+13 -13
View File
@@ -2,30 +2,30 @@ local utils = require("lua.lib.utils")
local M = {}
function M.is_user_unit_exists(unit)
return utils.command_success("systemctl --user cat " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
return utils.command_success("systemctl --user cat " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
end
M.user_unit_dir = CONFIG_HOME .. "/systemd/user"
function M.ensure_user_unit(unit, source)
if M.is_user_unit_exists(unit) then
return true
end
if M.is_user_unit_exists(unit) then
return true
end
local target_dir = M.user_unit_dir
local target = target_dir .. "/" .. unit
local target_dir = M.user_unit_dir
local target = target_dir .. "/" .. unit
local cmd = table.concat({
"mkdir -p " .. utils.shell_quote(target_dir),
"ln -s " .. utils.shell_quote(source) .. " " .. utils.shell_quote(target),
"systemctl --user daemon-reload",
}, " && ")
local cmd = table.concat({
"mkdir -p " .. utils.shell_quote(target_dir),
"ln -s " .. utils.shell_quote(source) .. " " .. utils.shell_quote(target),
"systemctl --user daemon-reload",
}, " && ")
return utils.command_success(cmd)
return utils.command_success(cmd)
end
function M.start_user_unit(unit)
return utils.command_success("systemctl --user start " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
return utils.command_success("systemctl --user start " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
end
return M