{ pkgs }: let wp-set = pkgs.writeShellScriptBin "wp-set" '' if [ -n "$1" ] && [ -e "$1" ]; then rm "$HOME/.config/wallpaper."* cp "$1" "$HOME/.config/wallpaper.''${1##*.}" fi ${pkgs.xwallpaper}/bin/xwallpaper --zoom "$HOME/.config/wallpaper."* ''; wp-rand = pkgs.writeShellScriptBin "wp-rand" '' ${wp-set}/bin/wp-set $(ls -1Ad "$HOME/Pictures/Wallpapers/"* | shuf | head -n 1) ''; wp = pkgs.writeShellScriptBin "wp" '' nsxiv="${pkgs.nsxiv}/bin/nsxiv" wpset="${wp-set}/bin/wp-set" $wpset "$($nsxiv -bfort "$HOME/Pictures/Wallpapers" | sed 1q)" ''; in pkgs.symlinkJoin { name = "wp"; paths = [ wp wp-rand wp-set ]; }