aboutsummaryrefslogtreecommitdiff
path: root/bin/xrbg
diff options
context:
space:
mode:
Diffstat (limited to 'bin/xrbg')
-rwxr-xr-xbin/xrbg12
1 files changed, 3 insertions, 9 deletions
diff --git a/bin/xrbg b/bin/xrbg
index 716a12c7..554c24dd 100755
--- a/bin/xrbg
+++ b/bin/xrbg
@@ -1,10 +1,4 @@
#!/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"
+# Apply a random background image. Requires rndf(1) and feh(1).
+bg=$(rndf "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}") || exit
+feh --bg-scale --no-fehbg -- "$bg"