aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-24 20:18:42 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-24 20:18:42 +1300
commitfc294c4ebb6206a364b96b51851193f2fc768573 (patch)
treee2a976c829bc245f92bd7e68f422431570af2a00 /bin
parentMerge branch 'release/v1.77.0' (diff)
downloaddotfiles-fc294c4ebb6206a364b96b51851193f2fc768573.tar.gz
dotfiles-fc294c4ebb6206a364b96b51851193f2fc768573.zip
Allow equal bounds in rndi(1df)
Calling rndi(1df) like `rndi 1 1` should work; it should just always yield one. Instead, it was complaining about the second bound not being greater than the first. I noticed this because I only had one background image in ~/.xbackgrounds and ran xrbg(1df), and it didn't know how to handle it.
Diffstat (limited to 'bin')
-rw-r--r--bin/rndi.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/rndi.awk b/bin/rndi.awk
index 7d5a5b96..02e0574f 100644
--- a/bin/rndi.awk
+++ b/bin/rndi.awk
@@ -13,8 +13,8 @@ BEGIN {
# Floor args and check for sanity
lower = int(ARGV[1] + 0)
upper = int(ARGV[2] + 0)
- if (lower >= upper)
- fail("Bounds must be numeric, first lower than second")
+ if (upper < lower)
+ fail("Bounds must be numeric, first not greater than second")
# Get a random seed if rnds(1df) available
rnds = "rnds 2>/dev/null"