I’ve just started experimenting with the Wayland compositor Hyprland and wanted to use my favorite wallpaper manager, Variety. Unfortunately, Variety does not support Hyprland out of the box. However, it’s easy to make it work also on Wayland.
I’m going to use Arch Linux in this blog post.
First of all, you must install “swaybg”, a wallpaper tool for Wayland compositors, and “variety”:
1 |
sudo pacman -S swaybg variety |
Now, start variety and do the first-time configuration. Currently, trying to change the wallpaper will not work.
Variety creates the directory “~/.config/variety/scripts”. Edit the file “set_wallpaper” inside that directory and search for the block starting like this:
1 |
if [[ -n $SWAYSOCK ]]; then |
Change it like that (you could also remove the part about SWAYSOCK if you want or if you don’t plan to use “sway” at all):
1 |
if [[ -n $SWAYSOCK || $XDG_CURRENT_DESKTOP == "Hyprland" ]] ; then |
This relies on the XDG_CURRENT_DESKTOP environment variable to be set accordingly, which should be like that automatically; you might want to check that:
1 2 |
echo $XDG_CURRENT_DESKTOP Hyprland |
Restart Variety, and now you can change the wallpaper!
Stay tuned for more posts on Hyprland 🙂
Pingback: Hyprland: getting started (part 1) | Lorenzo Bettini
Don’t forget to add ‘exec-once = variety &’ to your hyprland.conf so it starts up automatically the next time you start your computer 😉
Right! I was giving that for granted 😉
Pingback: Variety 在 Hyprland 上如何运作? | 开发者交流平台
I decided to go a different route. I wanted to use swww, because of its effects. So I added this to the script:
#hyprland
if pgrep -x “Hyprland” > /dev/null; then
echo “hyprland is running”
swww init
swww img $WP \
–transition-bezier .43,1.19,1,.4 \
–transition-fps=60 \
–transition-type=random \
–transition-duration=0.7 \
–transition-pos “$( hyprctl cursorpos )”
fi
Thanks! I’ll have to give it a try 🙂
How do you make Hyprland remember what the last wallpaper was?
Currently I don’t make it Hyprland remember the last wallpaper
Variety 0.8.12-1
Make the following change to the script at line #232 to ensure it functions correctly:
pidof swaybgPID=
if [[ -n $PID || $XDG_CURRENT_DESKTOP == "Hyprland" ]]; then