dot

packages and services management
Log | Files | Refs | README

commit 14b8a3f7f17a24bbaf089f0357d6bab56a6eb190
parent d950a808dc710efbd2cdb228e3c5ce077d8980a5
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Mon,  7 Aug 2017 21:30:43 +0200

simpler scripts, less interdependents

Diffstat:
Riomenu/bin/io-abduco -> abduco/bin/abduco-list | 0
Miomenu/bin/io | 53++++++++++++++++++++++++++---------------------------
Diomenu/bin/io-files | 3---
Mshell/bin/l | 23++++++++++++++---------
Rshell/bin/tree -> shell/bin/printree | 0
5 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/iomenu/bin/io-abduco b/abduco/bin/abduco-list diff --git a/iomenu/bin/io b/iomenu/bin/io @@ -5,11 +5,10 @@ # --- cache -------------------------------------------------------------------- -mkdir -p "$HOME/.cache" -touch "$HOME/.cache/io" +mkdir -p "$HOME/var/cache" +touch "$HOME/var/cache/io" [ "$1" = -c ] && find "$HOME" \ - -path "$HOME/.*" -prune -o \ -path "*/.git/*" -prune -o \ -path "*/.hg/*" -prune -o \ -path "${MAIL%/*}/*/*" -prune -o \ @@ -19,54 +18,54 @@ touch "$HOME/.cache/io" awk -v VAR="$VAR" -v MAIL="${MAIL%/*}" ' $0 ~ VAR "/irc/.*/$" { - ircv[ircc++] = $0; + ircv[ircc++] = $0 } $0 ~ MAIL "/*/" { - mailv[mailc++] = $0; + mailv[mailc++] = $0 } $0 ~ "/[.]git/$" || $0 ~ "/src/[^/]*/$" && $0 !~ "/git/.*/src/" && $0 !~ "/src/.*/src/" { - sub("/[.]git/$", "/"); - searchv[searchc++] = $0; + sub("/[.]git/$", "/") + searchv[searchc++] = $0 } $0 ~ VAR "/music" { - musicv[musicc++] = $0; + musicv[musicc++] = $0 } $0 ~ ".*\\.[1-9]p?(.gz)?$" { - manv[manc++] = $0; + manv[manc++] = $0 } $0 !~ "/$" { - filesv[filesc++] = $0; + filesv[filesc++] = $0 } END { - print "# irc"; - for (i = 0; i < ircc; i++) print(ircv[i] ); + print "# io-irc" + for (i = 0; i < ircc; i++) print(ircv[i] ) - print "# mail"; - for (i = 0; i < mailc; i++) print(mailv[i] ); + print "# io-mail" + for (i = 0; i < mailc; i++) print(mailv[i] ) - print "# search"; - for (i = 0; i < searchc; i++) print(searchv[i]); + print "# io-search" + for (i = 0; i < searchc; i++) print(searchv[i]) - print "# music"; - for (i = 0; i < musicc; i++) print(musicv[i] ); + print "# io-music" + for (i = 0; i < musicc; i++) print(musicv[i] ) - print "# man"; - for (i = 0; i < manc; i++) print(manv[i] ); + print "# io-man" + for (i = 0; i < manc; i++) print(manv[i] ) - print "# files"; - for (i = 0; i < filesc; i++) print(filesv[i] ); + print "# " ENVIRON["EDITOR"] + for (i = 0; i < filesc; i++) print(filesv[i] ) } -' > "$HOME/.cache/io" +' > "$HOME/var/cache/io" [ "$1" = -c ] && exit @@ -76,9 +75,9 @@ awk -v VAR="$VAR" -v MAIL="${MAIL%/*}" ' selection=$({ printf '# %s\n' abduco - io-abduco + abduco-list - cat "$HOME/.cache/io" + cat "$HOME/var/cache/io" printf '# %s\n' url cat "$HOME"/lib/url/* "$PKG/lib/url" @@ -86,7 +85,7 @@ selection=$({ } | iomenu -p io -s -h | cut -c 3-) -command="io-${selection%% *}" +command="${selection%% *}" path="${selection#* }" @@ -97,4 +96,4 @@ printf '\033[H\033[2J' cd "$(dirname "$path")" command -v "${command%% *}" && [ "$path" ] && -exec io-abduco "$path" $command "$path" +exec abduco-list "$path" $command "$path" diff --git a/iomenu/bin/io-files b/iomenu/bin/io-files @@ -1,3 +0,0 @@ -# Attach to an abduco session - -[ -f "$1" ] && $EDITOR "$1" diff --git a/shell/bin/l b/shell/bin/l @@ -1,13 +1,18 @@ -cd "${1:-.}" || exit 1 +if [ -d "${1:-.}" ] +then + cd "${1:-.}" || exit 1 -printf '%s/ ' "$PWD" + printf '## %s/ ' "$PWD" -git status -s --branch 2> /dev/null || printf '\n' + git status -s --branch 2> /dev/null || printf '##\n' -printf '\n' - -{ - ls -p | grep '/$' - ls -F | grep -v '/$' -} | column + { + ls -p | grep '/$' + ls -F | grep -v '/$' + } | column +elif [ -f "$1" ] +then + $PAGER "$1" + exit 0 +fi diff --git a/shell/bin/tree b/shell/bin/printree