dot

packages and services management
Log | Files | Refs | README

commit 5e7430571271ac4ecdc06553b4060042520313a4
parent 4161d093ebf677d70fa924c1f18b1fa656ba327d
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Wed,  9 Aug 2017 20:43:22 +0200

url -> uri

Diffstat:
Mii/start | 2+-
Miomenu/bin/io | 2+-
Miomenu/bin/io-search | 13+++++--------
Ashell/bin/uri | 36++++++++++++++++++++++++++++++++++++
Dshell/bin/url | 24------------------------
5 files changed, 43 insertions(+), 34 deletions(-)

diff --git a/ii/start b/ii/start @@ -1,4 +1,4 @@ -mkdir -p "$VAR/irc/$1" +mkdir -p "$VAR/irc/$domain" ii -s "$1" -i "$VAR/irc" -p "${2:-6667}" -n "$NICK" -k PASS -f "$NAME" \ > "$VAR/irc/$1/log" & PID=$! diff --git a/iomenu/bin/io b/iomenu/bin/io @@ -79,7 +79,7 @@ selection=$({ cat "$HOME/var/cache/io" - printf '# %s\n' url + printf '# %s\n' uri cat "$HOME"/lib/url/* "$PKG/lib/url" cut -d ' ' -f 1 "$HOME/.ssh/known_hosts" | sed -r 's|^|ssh://root@|' diff --git a/iomenu/bin/io-search b/iomenu/bin/io-search @@ -1,23 +1,20 @@ # interactively search a string in all code of a directory -output=`find "$1" -type f ! -path '*/.git/*' | sort | xargs -n 1 awk ' +output=$(find "$1" -type f ! -path '*/.git/*' | sort | xargs -n 1 awk ' FNR == 1 { printf("# %s\n", FILENAME); } { printf("%7s\t%s\n", FNR, $0); } -'` +') number=. while [ "$number" ] do -IFS=' ' read -r path number content << EOF -`printf '%s\n' "$output" | iomenu -s -h -p search` + IFS=' ' read -r path number content << EOF +$(printf '%s\n' "$output" | iomenu -s -h -p search) EOF - [ "$path" ] || exit path="${path#\# }" - io-abduco -n "$path" $EDITOR +"`printf %s "$number" | tr -d ' '`" "$path" + abduco-list "$path" done - - diff --git a/shell/bin/uri b/shell/bin/uri @@ -0,0 +1,36 @@ +# open a uri with appropriate programe +set -x + +case "$1" in +( http://* | https://* ) + exec ${BROWSER:-x-www-browser} "$1" + ;; +( ssh://* ) + exec ssh "${1#ssh://}" + ;; +( gopher://* ) + exec cgo "$1" + ;; +( irc://* ) + if [ -z "${1##irc://*:*}" ] + then pkg-service start ii "${1#*://}" "${1##*:}" + else pkg-service start ii "${1#*://}" 6667 + fi + exec irc-client "${1#*://}" + ;; +( file://* ) + exec $EDITOR "${1#*://}" + ;; +( git://* ) + mkdir -p "$GIT" + cd "$GIT" || exit 1 + git clone "$1" + ;; +( wiki://* ) + exec doc-wiki "${1#*://}" + ;; +( tox://* ) + pkg-service start tox + printf '' + ;; +esac diff --git a/shell/bin/url b/shell/bin/url @@ -1,24 +0,0 @@ -# open a url with appropriate programe - -case "$1" in -( http://* | https://* ) - exec ${BROWSER:-chromium} "$1" - ;; -( ssh://* ) - exec ssh "${1#ssh://}" - ;; -( gopher://* ) - exec cgo "$1" - ;; -( irc://* ) - url=${1#irc://} - case "$1" in - ( *:6697 ) port="-e ${url##*:}" ;; - ( *:* ) port="-p ${url##*:}" ;; - ( * | '' ) unset port ;; - esac - url=${url%:*} - - exec ii -i "$VAR/irc" -n "${NICK:-$USER}" -f "$NAME" -s "$url" $port - ;; -esac