2022-02-07 14:20:56 +01:00
|
|
|
{ pkgs }:
|
|
|
|
pkgs.writeShellApplication {
|
|
|
|
name = "randomWallpaper";
|
|
|
|
|
2023-01-07 17:06:00 +01:00
|
|
|
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq ];
|
2022-02-07 14:20:56 +01:00
|
|
|
|
|
|
|
text = ''
|
|
|
|
wallpaper="$(find ~/.config/wallpapers/ -type f,l | shuf -n 1)"
|
2023-01-07 17:06:00 +01:00
|
|
|
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
|
2022-02-07 14:20:56 +01:00
|
|
|
'';
|
|
|
|
}
|