dot

packages and services management
Log | Files | Refs | README

commit fe7ca723a916e729b2b1a62f5e17944a7502c934
parent 9b91fb8c54b09b9f48d00fd534c06487e201a48a
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Mon,  5 Jun 2017 19:54:40 +0200

do not renew ./bin/io cache every call

Diffstat:
M.profile | 14+-------------
Mbin/io | 98++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mngircd/start | 4++--
3 files changed, 53 insertions(+), 63 deletions(-)

diff --git a/.profile b/.profile @@ -1,16 +1,11 @@ . "$HOME/etc/profile" - -# info - export NAME='Josuah Demangeon' export NICK='josuah' +export MAIL="$VAR/mail/INBOX" export EMAIL='mail@josuah.net' export TZ='Europe/Paris' - -# default commands - export EDITOR='mg' export VISUAL='mg' export PAGER='less' @@ -19,21 +14,14 @@ export BROWSER='firefox' export TERM=vt200 - -# prompts - export PS1='$(prompt $?)' export PS2=' ' export PS3=' ' - -# startup - case "$(tty)" in ( /dev/tty* ) setfont "$ETC/consolefonts/lode-16.psf" printf '\033]P0000000\033]P7ffddaa\033[J' # color theme ;; esac - . "$ETC/alias" diff --git a/bin/io b/bin/io @@ -3,75 +3,79 @@ [ "$ABDUCO" ] && exit 1 -# --- find --------------------------------------------------------------------- +# --- cache -------------------------------------------------------------------- -nohup find "$HOME" \ +[ "$1" = -c ] && find "$HOME" \ -path "$HOME/.*" -prune -o \ -path "*/.git/*" -prune -o \ -path "*/.hg/*" -prune -o \ - -path "*/v" -prune -o \ -path "${MAIL%/*}/*/*" -prune -o \ -type d -exec printf '%s/\n' {} + -o \ - -print 2> /dev/null | -sort -o "/tmp/find" & + -print 2> /dev/null | sort | +awk -v VAR="$VAR" -v MAIL="${MAIL%/*}" ' -# --- select ------------------------------------------------------------------- + $0 ~ VAR "/irc/.*/$" { + ircv[ircc++] = $0; + } -selection=$({ - printf '# %s\n' abduco - io-abduco + $0 ~ MAIL "/*/" { + mailv[mailc++] = $0; + } + + $0 ~ "/[.]git/$" || + $0 ~ "/src/[^/]*/$" && + $0 !~ "/git/.*/src/" && + $0 !~ "/src/.*/src/" { + sub("/[.]git/$", "/"); + searchv[searchc++] = $0; + } + + $0 ~ VAR "/music" { + musicv[musicc++] = $0; + } - awk -v VAR="$VAR" -v MAIL="${MAIL%/*}" ' + $0 ~ "/man/.*.[1-9](.gz)?$" { + manv[manc++] = $0; + } -$0 ~ VAR "/irc/.*/$" { - ircv[ircc++] = $0; -} + $0 !~ "/$" { + filesv[filesc++] = $0; + } -$0 ~ MAIL { - mailv[mailc++] = $0; -} + END { + print "# irc"; + for (i = 0; i < ircc; i++) print(ircv[i] ); -$0 ~ "/[.]git/$" || -$0 ~ "/src/[^/]*/$" && -$0 !~ "/git/.*/src/" && -$0 !~ "/src/.*/src/" { - sub("/[.]git/$", "/"); - searchv[searchc++] = $0; -} + print "# mail"; + for (i = 0; i < mailc; i++) print(mailv[i] ); -$0 ~ VAR "/music" { - musicv[musicc++] = $0; -} + print "# search"; + for (i = 0; i < searchc; i++) print(searchv[i]); -$0 ~ "/man/.*.[1-9](.gz)?$" { - manv[manc++] = $0; -} + print "# music"; + for (i = 0; i < musicc; i++) print(musicv[i] ); -$0 !~ "/$" { - filesv[filesc++] = $0; -} + print "# man"; + for (i = 0; i < manc; i++) print(manv[i] ); -END { - print "# irc"; - for (i = 0; i < ircc; i++) print(ircv[i] ); + print "# files"; + for (i = 0; i < filesc; i++) print(filesv[i] ); + } - print "# mail"; - for (i = 0; i < mailc; i++) print(mailv[i] ); +' > "$HOME/.cache/io" - print "# search"; - for (i = 0; i < searchc; i++) print(searchv[i]); +[ "$1" = -c ] && exit - print "# music"; - for (i = 0; i < musicc; i++) print(musicv[i] ); - print "# man"; - for (i = 0; i < manc; i++) print(manv[i] ); +# --- select ------------------------------------------------------------------- + +selection=$({ - print "# files"; - for (i = 0; i < filesc; i++) print(filesv[i] ); + printf '# %s\n' abduco + io-abduco -}' "$HOME/.cache/find" + cat "$HOME/.cache/io" printf '# %s\n' url cat "$HOME"/var/url/* "$ETC/var/url" @@ -82,8 +86,6 @@ END { command="io-${selection%% *}" path="${selection#* }" -mv /tmp/find "$HOME/.cache/find" - # --- run ---------------------------------------------------------------------- diff --git a/ngircd/start b/ngircd/start @@ -1,2 +1,2 @@ -echo "yes" -read line +echo "$$" +exec ngircd -f "$ETC/ngircd/ngircd.conf" -n