From e6764e6e9053ad6ec584f87df842d5eb5dc99d6b Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Tue, 7 Jan 2020 10:41:44 -0500 Subject: [PATCH] fish: use ruby instead of awk for word of the moment --- fish/prompt | 4 ++-- text/mid.awk | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 text/mid.awk diff --git a/fish/prompt b/fish/prompt index 5277bbb..e4f0b3e 100644 --- a/fish/prompt +++ b/fish/prompt @@ -22,8 +22,8 @@ function fish_greeting if test -f /usr/share/dict/words && test (which shuf) set_color c50ed2 - echo "Word of the moment: "(shuf -n1 /usr/share/dict/words) | - awk -f $_agw_dir_rc/text/mid.awk col=$COLUMNS + echo -n "Word of the moment: "(shuf -n1 /usr/share/dict/words) | + ruby -e 'puts $stdin.read.center ARGV[0].to_i' $COLUMNS set_color normal end diff --git a/text/mid.awk b/text/mid.awk deleted file mode 100644 index f9832ac..0000000 --- a/text/mid.awk +++ /dev/null @@ -1,6 +0,0 @@ -{ - z = col - length - y = int(z / 2) - x = z - y - printf "%*s%s%*s\n", x, "", $0, y, "" -}