From 34b331ddbc98d2969e4984977b80827557d31c4a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 3 Jan 2017 19:46:06 +1300 Subject: Add bcq(1df), tiny shut-up bc(1) wrapper for X11 --- README.markdown | 1 + X/xbindkeysrc | 2 +- bin/bcq | 4 ++++ man/man1/bcq.1df | 13 +++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 bin/bcq create mode 100644 man/man1/bcq.1df diff --git a/README.markdown b/README.markdown index 39bc3666..971e764b 100644 --- a/README.markdown +++ b/README.markdown @@ -415,6 +415,7 @@ Installed by the `install-bin` target: intended as a framework for shell wrappers or functions. * `ax(1df)` evaluates an awk expression given on the command line; this is intended as a quick way to test how Awk would interpret a given expression. +* `bcq(1df)` runs `bc(1)`, quieting it down if need be. * `bel(1df)` prints a terminal bell character. * `bl(1df)` generates a given number of blank lines. * `bp(1df)` runs `br(1df)` after prompting for an URL diff --git a/X/xbindkeysrc b/X/xbindkeysrc index 22f1ce98..00855b09 100644 --- a/X/xbindkeysrc +++ b/X/xbindkeysrc @@ -28,5 +28,5 @@ "exec amixer -q sset Master 5%- unmute" XF86AudioLowerVolume -"exec urxvtcd -e bc" +"exec urxvtcd -e bcq" XF86Calculator diff --git a/bin/bcq b/bin/bcq new file mode 100755 index 00000000..7b950b56 --- /dev/null +++ b/bin/bcq @@ -0,0 +1,4 @@ +#!/bin/sh +# Fire up bc(1), hushing it if it looks like GNU +[ -e "$HOME"/.cache/bc/quiet ] && set -- --quiet "$@" +exec bc "$@" diff --git a/man/man1/bcq.1df b/man/man1/bcq.1df new file mode 100644 index 00000000..1e67c4e2 --- /dev/null +++ b/man/man1/bcq.1df @@ -0,0 +1,13 @@ +.TH CALC 1df "January 2017" "Manual page for bcq" +.SH NAME +.B bcq +\- run bc(1), quieting it if need be +.SH SYNOPSIS +.B bcq +.SH DESCRIPTION +.B bcq +starts bc(1), checking ~/.cache/bc/quiet to see if a --quiet option is +available, adding it if so to elide the annoying GNU boilerplate for an +interactive session. +.SH AUTHOR +Tom Ryder -- cgit v1.2.3