add support for hyprpaper for randomWallpaper script

This commit is contained in:
Moritz Böhme 2023-01-07 17:06:00 +01:00
parent c3e6687ded
commit d4ce7ee5d3
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
5 changed files with 9 additions and 2 deletions

View file

@ -2,10 +2,16 @@
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "randomWallpaper"; name = "randomWallpaper";
runtimeInputs = with pkgs; [ findutils coreutils feh ]; runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq ];
text = '' text = ''
wallpaper="$(find ~/.config/wallpapers/ -type f,l | shuf -n 1)" wallpaper="$(find ~/.config/wallpapers/ -type f,l | shuf -n 1)"
feh --bg-fill "$wallpaper" if [ -z ''${WAYLAND_DISPLAY+x} ]; then
feh --bg-fill "$wallpaper"
else
hyprctl hyprpaper preload "$wallpaper"
hyprctl monitors -j | jq '.[].name' | xargs -I{} hyprctl hyprpaper wallpaper '{}',"$wallpaper"
hyprctl hyprpaper unload all
fi
''; '';
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

View file

@ -198,4 +198,5 @@ in
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
exec-once=synology-drive exec-once=synology-drive
exec-once=randomWallpaper
'' ''