From 7ed9b9a93a8c6d744a377c6cd2485da2de7cf1d8 Mon Sep 17 00:00:00 2001 From: Pierre-Edouard Portier Date: Mon, 2 Jan 2023 22:43:00 +0100 Subject: [PATCH] 2 jan 2023 --- bin/a | 3 ++- bin/abig | 28 ++++++++++++++++++++++++++++ bin/gg | 3 +++ plumbing | 18 ++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 bin/abig create mode 100755 bin/gg diff --git a/bin/a b/bin/a index 1a67c60..886e881 100755 --- a/bin/a +++ b/bin/a @@ -24,4 +24,5 @@ fi # In `win`, Node.js REPL looks nicer without ANSI codes export NODE_NO_READLINE=1 -acme -a -f /mnt/font/AndaleMono/13a/font $1 +# /mnt/font/AndaleMono/13a/font +acme -a -f /mnt/font/InputMonoNarrow-Regular/13a/font $1 diff --git a/bin/abig b/bin/abig new file mode 100755 index 0000000..c86ab19 --- /dev/null +++ b/bin/abig @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +export SHELL="/bin/bash" +export acmeshell="/bin/bash" +export BROWSER=safari +export tabstop=4 +export TERM=dumb +export PAGER=nobs + +# Path to 'a' script itself +acme_bin_dir=$( cd $(dirname $0) && pwd ) + +# Where are the plumber rules? +acme_plumber_rules="$acme_bin_dir/../plumbing" + +if [ "$(pgrep plumber)" ]; then + echo plumber is running +else + echo starting plumber + plumber + cat "$acme_plumber_rules" "$PLAN9/plumb/basic" | 9p write plumb/rules +fi + +# In `win`, Node.js REPL looks nicer without ANSI codes +export NODE_NO_READLINE=1 + +# /mnt/font/AndaleMono/13a/font +acme -a -f /mnt/font/InputMonoNarrow-Regular/20a/font $1 diff --git a/bin/gg b/bin/gg new file mode 100755 index 0000000..bbc2778 --- /dev/null +++ b/bin/gg @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +git grep -n "$@" \ No newline at end of file diff --git a/plumbing b/plumbing index e69de29..af33aa9 100644 --- a/plumbing +++ b/plumbing @@ -0,0 +1,18 @@ +# urls go to web browser +type is text +data matches '(https?|ftp|file|gopher|mailto|news|nntp|telnet|wais|prospero)://[a-zA-Z0-9_@\-]+([.:][a-zA-Z0-9_@\-]+)*/?[a-zA-Z0-9_?,%#~&/\-+=]+([:.][a-zA-Z0-9_?,%#~&/\-+=]+)*' +plumb start open $0 + +# image files go to osx default +type is text +data matches '[a-zA-Z¡-￿0-9_\-./]+' +data matches '([a-zA-Z¡-￿0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG)' +arg isfile $0 +plumb start open $file + +# postscript/pdf/dvi go to osx default +type is text +data matches '[a-zA-Z¡-￿0-9_\-./]+' +data matches '([a-zA-Z¡-￿0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)' +arg isfile $0 +plumb start open $0 \ No newline at end of file