aboutsummaryrefslogtreecommitdiff
path: root/bin/xrbg
blob: 716a12c7008b20450fd8b10b6d80254927929435 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
# Apply a random background image. Requires feh(1).
set -- "${XBACKGROUNDS:-$HOME/.xbackgrounds}"/*
if ! [ -e "$1" ] ; then
    printf 'xrbg: No files found in %s\n' "$bgd"
    exit 1
fi
argi=$(rndi 1 "$#") || exit
shift "$((argi-1))"
feh --bg-scale --no-fehbg -- "$1"