#!/bin/sh [ -f "$1" ] || exit 1 if [ -d $1 ]; then bg=$(ls $1 | shuf -n 1) elif [ -f $1 ]; then bg=$1 else exit 1 fi feh --bg-fill "$bg"