add support for hyprpaper for randomWallpaper script

nixos
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 {
name = "randomWallpaper";
runtimeInputs = with pkgs; [ findutils coreutils feh ];
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq ];
text = ''
wallpaper="$(find ~/.config/wallpapers/ -type f,l | shuf -n 1)"
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
exec-once=synology-drive
exec-once=randomWallpaper
''