aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown1
-rw-r--r--X/xinitrc.d/xbackground.sh3
-rw-r--r--X/xinitrc.d/xrbg.sh2
-rwxr-xr-xbin/xrbg4
-rw-r--r--man/man1/xrbg.1df19
5 files changed, 26 insertions, 3 deletions
diff --git a/README.markdown b/README.markdown
index 5c70a17d..b0982a7d 100644
--- a/README.markdown
+++ b/README.markdown
@@ -509,6 +509,7 @@ Installed by the `install-bin` target:
* `vest(1df)` runs `test(1)` but fails with explicit output via `vex(1df)`.
* `vex(1df)` runs a command and prints `true` or `false` explicitly to
`stdout` based on the exit value.
+* `xrbg(1df)` applies the same randomly-selected background to each X screen.
* `xrq(1df)` gets the values of specific resources out of `xrdb -query`
output.
diff --git a/X/xinitrc.d/xbackground.sh b/X/xinitrc.d/xbackground.sh
deleted file mode 100644
index 7f2bc8c3..00000000
--- a/X/xinitrc.d/xbackground.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Apply a random background image
-command -v feh >/dev/null 2>&1 || return
-feh --bg-scale --no-fehbg --randomize -- "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}"
diff --git a/X/xinitrc.d/xrbg.sh b/X/xinitrc.d/xrbg.sh
new file mode 100644
index 00000000..0e4ec278
--- /dev/null
+++ b/X/xinitrc.d/xrbg.sh
@@ -0,0 +1,2 @@
+# Apply a random background image
+xrbg
diff --git a/bin/xrbg b/bin/xrbg
new file mode 100755
index 00000000..801bf078
--- /dev/null
+++ b/bin/xrbg
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Apply a random background image. Requires rndf(1df) and feh(1).
+bg=$(rndf "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}") || exit
+feh --bg-scale --no-fehbg -- "$bg"
diff --git a/man/man1/xrbg.1df b/man/man1/xrbg.1df
new file mode 100644
index 00000000..481c9185
--- /dev/null
+++ b/man/man1/xrbg.1df
@@ -0,0 +1,19 @@
+.TH XRBG 1df "March 2016" "Manual page for xrbg"
+.SH NAME
+.B xrbg
+\- apply a random X background image with feh(1)
+.SH SYNOPSIS
+.B xrbg
+.br
+XBACKGROUNDS=/path/to/images
+.B xrbg
+.SH DESCRIPTION
+.B xrbg
+searches for images in the directory named in the XBACKGROUNDS environment
+variable (defaults to ~/.xbackgrounds), chooses a random one with rndf(1df),
+and applies it with feh(1). It's designed for use in ~/.xinitrc, but it seems
+to work when called manually from within an X session too.
+.SH SEE ALSO
+feh(1), rndf(1df)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>