diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 10:46:44 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-01 10:46:44 +1200 |
commit | c5d59466ac322aff4695fed34019c1dde07498a0 (patch) | |
tree | d1e1103892ac52fbc19d802523e0f9ea0c92c267 | |
parent | Add rndf(1) (diff) | |
download | dotfiles-c5d59466ac322aff4695fed34019c1dde07498a0.tar.gz dotfiles-c5d59466ac322aff4695fed34019c1dde07498a0.zip |
Change xrbg(1) to use rndf(1)
-rwxr-xr-x | bin/xrbg | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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" |