# Get a low-quality random number between two integers. Depending on the awk # implementation, if you don't have rnds(1df) available to generate a seed of # sufficient quality, you might get very predictable random numbers based on # the current epoch second. BEGIN { self = "rndi" # Check we have two arguments if (ARGC != 3) fail("Need a lower and upper bound") # Floor args and check for sanity lower = int(ARGV[1] + 0) upper = int(ARGV[2] + 0) 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" rnds | getline seed close(rnds) # Truncate the seed to 8 characters because mawk might choke on it seed = substr(seed,1,8) if (length(seed)) srand(seed + 0) else srand() # Print a random integer bounded by the first and second arguments print int(lower + rand() * (upper - lower + 1)) # Bail before processing any lines exit } # Bailout function function fail(str) { stderr = "cat >&2" printf "%s: %s\n", self, str | stderr close(stderr) exit(2) } outsummaryrefslogtreecommitdiff
path: root/X
Commit message (Collapse)AuthorAgeFilesLines
* Use tabs for sxhkdrcTom Ryder2020-05-091-16/+16
|
* Use full "mouse" for xset(1) call in ~/.xinitrcTom Ryder2018-11-251-1/+1
| | | | | | | From xset(1): > The m option controls the mouse parameters; it may be abbreviated to > 'm'.
* Remove a couple of unneeded XTerm resourcesTom Ryder2018-11-221-2/+0
|
* Correctly specify XTerm resourcesTom Ryder2018-11-221-24/+24
| | | | | I never would have guessed that "vt100" was what I was missing here... but a closer reading of the xterm(1) manual page does show it.
* Rename xterm resources file to "XTerm"Tom Ryder2018-11-223-27/+27
|
* Remove reference to X/Xresources.d/Xft.Tom Ryder2018-11-221-1/+0
| | | | The file was removed in b456da1, but the reference to it was not.
* Add color definitions to xterm resourcesTom Ryder2018-11-221-0/+18
|
* Correct TERM string for xtermTom Ryder2018-11-221-1/+1
| | | | | Looks like this went in when the xterm resource type was created; it was probably from when I was experimenting with monochrome terminals.
* Remove some resources from URxvtTom Ryder2018-11-221-2/+0
| | | | Neither of these are needed since b456da1.
* Remove mpdlrc setup from Xinitrc.dTom Ryder2018-11-221-3/+0
| | | | | I haven't used it in some time, and it's due to be properly ported to my Music::Lyrics::LRC library.
* Apply some logic to choose a GUI browserTom Ryder2018-11-221-3/+23
| | | | | I'll want to use Dillo if I'm on a machine with limited memory, but the balance tips in favour of Firefox if I have RAM to spare.
* Remove colon alignment from .Xresources subfilesTom Ryder2018-11-222-40/+40
|
* Remove font settingsTom Ryder2018-11-223-8/+0
| | | | | | I'm pretty tired of messing with all these. The defaults are fine, and render nice and quickly; it's just too much of a hassle making it all pixel-perfect, and the anti-aliasing is so often just rubbish.
* Mod4+v fires up vimTom Ryder2017-04-131-0/+3
|
* Switch from xbindkeys to sxhkdTom Ryder2017-02-254-47/+47
| | | | Smaller, easier
* Add a start at an XTerm configTom Ryder2017-02-242-0/+10
|
* Alphabetical resources sortTom Ryder2017-02-241-1/+1
|
* Remove SHLVL nested shell feature for nowTom Ryder2017-01-242-3/+1
| | | | | Causes a bit too much curliness in configuration; may need a more comprehensive approach.
* Restore xrbg(1df)Tom Ryder2017-01-152-3/+2
| | | | | | | | | I switched to an xrandr(1)-based layout and feh(1)'s --randomize option applies a random background to each screen. I can't see a way of applying the same background to each screen, but xrbg(1df) does it, so I've restored it here. This reverts commit 1a0ac5be601f00e828dba181a7c90c2b29735b77.
* Bind Mod4+m to pull up tmux instanceTom Ryder2017-01-141-0/+3
|