#!/usr/bin/env bash function getpaper(){ FILES=/home/cloud/Documents/Wallpapers/* for f in $FILES; do #echo $f NAME=$(echo $f | tr '/' '\n' | tail -n1) #echo $NAME #notify-send "$NAME" >/dev/null FRAGQ=$(echo $NAME | grep frag) if [ ${#FRAGQ} -gt 0 ]; then echo "text:$NAME" elif [ -d $f ]; then echo "text:$NAME" else echo "img:$f:text:$NAME" fi #sleep 0.15 done } result=$(getpaper | wofi -I --show dmenu) echo $result LEN=${#result} FRAGQ=$(echo $result | grep frag) FRAGQ=${#FRAGQ} if [ $LEN -gt 0 ]; then killall swaybg killall glpaper if [ $FRAGQ -gt 0 ]; then glpaper DP-1 ~/Documents/Wallpapers/$result & disown glpaper HDMI-A-1 ~/Documents/Wallpapers/$result & disown else swaymsg output "*" background /home/cloud/Documents/Wallpapers/$result fill fi fi