我正在尝试在 Hyprland 中使用 Variety,但我尚未在网络上的任何地方找到文章或问题。
谁能告诉我如何将它集成到我的 hyprland.conf 中?
详见此处 https://www.lorenzobettini.it/2023/05/hyprland-and-the-variety-wallpaper-manager/ 您必须首先安装
swaybg
,然后通过更改来编辑文件 ~/.config/variety/scripts/set_wallpaper
线
if [[ -n $SWAYSOCK ]]; then
变成类似的东西
if [[ -n $SWAYSOCK || $XDG_CURRENT_DESKTOP == "Hyprland" ]] ; then
或者简单地(如果您不打算使用“摇摆”)
if [[ $XDG_CURRENT_DESKTOP == "Hyprland" ]] ; then
现在,Variety 可以更改您的壁纸。
将此添加到 .config/variety/scripts/set_wallpaper
if [[ $XDG_SESSION_DESKTOP == "hyprland" ]] ; then
# If swaybg is available, use it as prevents system freeze.
# See https://github.com/swaywm/sway/issues/5606
if command -v "swaybg" >/dev/null 2>&1; then
# Grey background flicker is prevented by killing old swaybg process after new one.
# See https://github.com/swaywm/swaybg/issues/17#issuecomment-851680720
PID=`pidof swaybg`
swaybg -i "$WP" -m fill &
if [ ! -z "$PID" ]; then
sleep 1
kill $PID 2>/dev/null
fi
else
swaymsg output "*" bg "$WP" fill 2> /dev/null
fi
fi