From c5d59466ac322aff4695fed34019c1dde07498a0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 1 Aug 2016 10:46:44 +1200 Subject: Change xrbg(1) to use rndf(1) --- bin/xrbg | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'bin') 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" -- cgit v1.2.3