Update Hyprland config for Matugen and untrack generated files.
This commit is contained in:
1 parent
60fe219ff7
commit
16cf5e0c2e
10 files changed
+47
-55
No files matched your search
+18
-10
@@ -290,7 +290,8 @@ function M.randomizeWallpaper()
|
||||
-- Pick a unique random image for each monitor
|
||||
math.randomseed(os.time())
|
||||
local used = {}
|
||||
local matugen_cmds = {}
|
||||
local primary_img = nil
|
||||
local fallback_img = nil
|
||||
local primary_logical_name = "eDP-1"
|
||||
for _, mon in ipairs(monitors) do
|
||||
if mon.description and mon.description:match("E3LMTF071391") then
|
||||
@@ -320,26 +321,24 @@ function M.randomizeWallpaper()
|
||||
table.insert(conf_lines, "}")
|
||||
table.insert(conf_lines, "")
|
||||
|
||||
if not fallback_img then fallback_img = img end
|
||||
|
||||
local logical_name = mon.name
|
||||
if mon.description then
|
||||
if mon.description:match("E3LMTF071438") then logical_name = "DP-7" end
|
||||
if mon.description:match("E3LMTF071391") then logical_name = "DP-8" end
|
||||
end
|
||||
local matugen_cmd = "matugen image '" .. img .. "' -c /home/trey/src/dotfiles/matugen/matugen-" .. logical_name .. ".toml --source-color-index 0"
|
||||
|
||||
-- Push primary monitor to the end of the array so its global configs (like tmux) overwrite the others
|
||||
if logical_name == primary_logical_name then
|
||||
table.insert(matugen_cmds, matugen_cmd)
|
||||
else
|
||||
table.insert(matugen_cmds, 1, matugen_cmd)
|
||||
primary_img = img
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #matugen_cmds > 0 then
|
||||
local all_cmds = table.concat(matugen_cmds, " ; ")
|
||||
local matugen_img = primary_img or fallback_img
|
||||
if matugen_img then
|
||||
local matugen_cmd = "matugen image '" .. matugen_img .. "' -c " .. home .. "/src/dotfiles/matugen/config.toml --source-color-index 0"
|
||||
local reload_cmd = M.reloadAppsCmd()
|
||||
hl.dispatch(hl.dsp.exec_cmd("bash -c \"" .. all_cmds .. " ; " .. reload_cmd .. "\""))
|
||||
hl.dispatch(hl.dsp.exec_cmd("bash -c \"" .. matugen_cmd .. " ; " .. reload_cmd .. "\""))
|
||||
end
|
||||
|
||||
local c = io.open(home .. "/.config/hypr/hyprpaper.conf", "w")
|
||||
@@ -409,4 +408,13 @@ function M.setupMonitors()
|
||||
-- hl.dispatch(hl.dsp.exec_cmd("bash -c '" .. table.concat(waybar_cmds, "\n") .. "'"))
|
||||
end
|
||||
|
||||
function M.fixHyprlock(clear_only)
|
||||
if clear_only then
|
||||
hl.clear_crashed_lockscreen()
|
||||
else
|
||||
hl.config({ misc = { allow_session_lock_restore = true } })
|
||||
hl.dispatch(hl.dsp.exec_cmd("hyprlock"))
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in new issue
Block a user