From 91d32481348ec42a747fc181a018f879a49242d0 Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Tue, 19 May 2020 13:38:27 +0200 Subject: [PATCH] Add 'randoman' and 'randoaw' scripts --- .local/bin/scripts/randoman | 6 ++++++ .local/bin/scripts/randomaw | 5 +++++ 2 files changed, 11 insertions(+) create mode 100755 .local/bin/scripts/randoman create mode 100755 .local/bin/scripts/randomaw diff --git a/.local/bin/scripts/randoman b/.local/bin/scripts/randoman new file mode 100755 index 0000000..75658dc --- /dev/null +++ b/.local/bin/scripts/randoman @@ -0,0 +1,6 @@ +#!/bin/sh + +# Open random man page. + +man "$(a="$(shuf -i 1-"$(man -k . | wc -l)" -r -n 1)" && man -k . | \ + awk -v v="$a" 'NR==v {print $1}')" diff --git a/.local/bin/scripts/randomaw b/.local/bin/scripts/randomaw new file mode 100755 index 0000000..496da86 --- /dev/null +++ b/.local/bin/scripts/randomaw @@ -0,0 +1,5 @@ +#!/bin/sh + +# Open random Arch Wiki page in w3m. + +w3m "https://wiki.archlinux.org/index.php/Special:Random"