#!/bin/sh NIXDIR=/nix/store/kiy3icfvkh4xmla6z3ll9mbp3h0hnij2-generated-wallpaper-sorahiro-soft WPDIR=$NIXDIR/share/wallpaper/ IMGS=$(find $WPDIR -type f -print) RES=$(echo "$IMGS" | awk -v dir="$WPDIR" '{ image_file = $0; gsub("^" dir, "", image_file); print "img:" $0 ":text:" image_file; }') IMG=$WPDIR/$(echo "$RES" | wofi --dmenu --allow-images show-icons true -theme-str '#window { width: 50%; }' -p "Choose wallpaper:") IMG=$(echo "$IMG" | awk -F ':' '{print $2}') echo "$IMG" swww img $IMG