Files
Hyprdots/lua/modules/swaync.lua
T
2026-05-28 01:31:30 -04:00

37 lines
740 B
Lua

local settings = require("lua.lib.settings")
local systemd = require("lua.lib.systemd")
local utils = require("lua.lib.utils")
require("lua.lib.globals")
local M = {}
local function start_swaync()
if settings["systemd"] then
local unit = "swaync.service"
local source = CONFIG_HOME .. "hypr/systemd/" .. unit
if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swaync")
else
hl.exec_cmd("swaync")
end
else
hl.exec_cmd("swaync")
end
end
local function stop_swaync()
if settings["systemd"] and utils.command_success("systemctl --user status swaync") then
hl.exec_cmd("systemctl --user stop swaync")
end
end
M.autostart = {
start_swaync,
}
M.autostop = {
stop_swaync,
}
return M