feat: add change wallpaper shortcut to yazi

This commit is contained in:
danny 2025-11-10 15:21:18 +08:00
parent d1f25b377f
commit c45ba82b90
18 changed files with 188 additions and 21 deletions

View file

@ -2,9 +2,11 @@
let
mkWall = pkgs.writeShellScriptBin "setWall" ''
url="$1"
filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
DIR="$HOME/Pictures/Wallpapers"
filepath="$DIR/$(echo -n "$url" | sha256sum | awk '{print $1}' | tr -d '\n').jpg"
if [[ ! -f "$filepath" ]]; then
${pkgs.libnotify}/bin/notify-send " Wallpaper" "$filepath\nDownloading..."
curl -sL "$url" -o "$filepath"
fi