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
No known key found for this signature in database
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)"
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
'';
}