-- 自启动程序(对应 startup.conf 中的 exec-once) -- 参考 https://wiki.hypr.land/Configuring/Basics/Autostart/ -- Lua 中对应 exec-once 的写法:在 hyprland.start 事件中执行 hl.on("hyprland.start", function() -- 顶部菜单 / shell -- hl.exec_cmd("polybar -q -c ~/.config/polybar/config.ini -r") -- hl.exec_cmd("waybar") -- hl.exec_cmd("ashell --config-path /home/catilgrass/.config/ashell/config.toml") hl.exec_cmd("noctalia") -- Seatd hl.exec_cmd("seatd -g video") -- 总览 hl.exec_cmd("hyprpm enable Hyprspace") -- 壁纸:从 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") hl.exec_cmd("wl-paste --type image --watch cliphist store") -- Overview -- hl.exec_cmd("hyprctl plugin load ~/.config/hypr/plugins/hyprspace.so") -- 验证器 hl.exec_cmd("/usr/lib/mate-polkit/polkit-mate-authentication-agent-1") -- 通知 hl.exec_cmd("/home/catilgrass/Scripts/dunst-daemon.sh") -- 截图 -- hl.exec_cmd("flameshot") -- FCITX5 hl.exec_cmd("fcitx5 --replace -d") -- 修复 xdg-desktop-portal:把 Wayland 会话环境同步给 systemd 用户会话, -- 并重启 portal(否则 xdph 会以 "Couldn't connect to a wayland compositor" 失败, -- 回退到 gtk.portal,导致屏幕共享等不可用) hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE") hl.exec_cmd("systemctl --user restart xdg-desktop-portal-hyprland.service xdg-desktop-portal.service") end)