diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-14 06:27:42 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-14 06:27:42 +0800 |
| commit | 63c7df65f7f4a64f482513b8e157cde8e5aacb37 (patch) | |
| tree | d1b50e520cb55efd2c75aa39d115d8fbe8c083bf /startup.lua | |
| parent | acf40f1e9ec1bd5212d2d6da696470750e6573db (diff) | |
refactor(wallpaper): switch from hyprpaper to swaybg
Replace hyprpaper with swaybg due to a crash in hyprpaper 0.8.4 on this
system. Update the wallpaper script to use wofi and persist the current
wallpaper path.
Diffstat (limited to 'startup.lua')
| -rw-r--r-- | startup.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/startup.lua b/startup.lua index 2a8b415..9462fc5 100644 --- a/startup.lua +++ b/startup.lua @@ -14,8 +14,25 @@ hl.on("hyprland.start", function() -- 总览 hl.exec_cmd("hyprpm enable Hyprspace") - -- 壁纸 - hl.exec_cmd("hyprpaper") + -- 壁纸:从 current_wallpaper 文件读取当前壁纸路径(由 switch_wallpaper.sh 写入) + -- 注意:hyprpaper 0.8.4 会因 hyprtoolkit 的 cursor-shape 处理在本机 Hyprland 上崩溃 + -- (GPF in wl_proxy_marshal_array_flags),改用 swaybg(纯 layer-shell 实现,无此问题) + local function currentWallpaper() + local f = io.open("/home/catilgrass/.config/hypr/current_wallpaper", "r") + if f then + local path = f:read("*l") + f:close() + if path and path ~= "" then + local g = io.open(path, "r") + if g then + g:close() + return path + end + end + end + return "/home/catilgrass/图片/Wallpapers/KON_2.png" -- 默认壁纸 + end + hl.exec_cmd("swaybg -i '" .. currentWallpaper() .. "' -m fill") -- 剪贴板 (只存文本/图片数据) hl.exec_cmd("wl-paste --type text --watch cliphist store") |
