#!/usr/bin/fish

set dir "$HOME/Pictures/Backgrounds/"
set chosen (
  for file in (find $dir -type f)
    if test -z $img; or test $file != $img
      echo -en "$file\0icon\x1fthumbnail://$file\n"
    end
  end | rofi -dmenu -p " " -show-icons -theme ~/.config/rofi/wallpapermenu.rasi)

~/.config/scripts/set_background (echo $chosen)
