plumber

Plumber – a modern approach to plumbing
git clone git://r-36.net/plumber
Log | Files | Refs | LICENSE

commit 173e0948bbe662e9b9fbdef73908cf4f690ad287
parent 16684fd6d6ebf5ce17a6025ad76104d11681f7d7
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun, 26 Mar 2017 19:03:56 +0200

Add a simple way to navigate to local paper storage.

paper:$HOME/papers/topic

Diffstat:
bin/plumber | 1+
openers/paperopener | 14++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/bin/plumber b/bin/plumber @@ -47,6 +47,7 @@ plumbrules = [ ["^ldaps://.*", "ldapopener '%s'"], ["^moz://:*", "mozopener '%s'"], ["^mms://.*", "mediaopener '%s'"], + ["^paper:.*", "paperopener '%s'"], ["^rfc:.*", "rfcopener '%s'"], ["^rp:.*", "rpopener '%s'"], ["^rpo:.*/", "rpopener -o '%s'"], diff --git a/openers/paperopener b/openers/paperopener @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ $# -lt 1 ]; +then + printf "usage: [-o] %s URI\n" "$(basename "$0")" >&2 + exit 1 +fi + +[ -z "$FILEMANAGER" ] && FILEMANAGER="ranger" + +URI="$(printf "%s" "$1" | cut -d':' -f 2-)" + +st -e sh -c "cd \"${URI}\" && ${FILEMANAGER}" +