dot

packages and services management
Log | Files | Refs | README

commit c6a43fe7a72f73ae735d4448da81de7faa3291dc
parent cc7845875efa934d487febb2caccbb3e533fcff3
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 14 May 2017 11:49:54 +0200

added ii-log

Diffstat:
M.profile | 14++++++++++----
Abin/daemon | 0
Abin/ii-log | 36++++++++++++++++++++++++++++++++++++
Mbin/io | 8++++----
Mbin/screen-brightness | 4+---
Mbin/status | 9++-------
Mbuild/st/build | 4++--
Minstall | 4+---
8 files changed, 56 insertions(+), 23 deletions(-)

diff --git a/.profile b/.profile @@ -31,7 +31,7 @@ LIBPATH="$ROOT/lib:$LIBPATH" LD_RUN_PATH="$ROOT/lib:$LD_RUN_PATH" LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" -export MANPATH LIBPATH LD_RUN_PATH LD_LIBRARY_PATH +export LIBPATH LD_RUN_PATH LD_LIBRARY_PATH # system paths @@ -42,9 +42,15 @@ PATH="$( awk -v RS=':' -v ORS=':' '!path[$0] { path[$0] = 1; print; }' | sed 's/:$//' )" -MANPATH="$ETC/man:$ROOT/share/man:$ROOT/man:$MANPATH" - -export ENV MANPATH +unset MANPATH +for dir in /man /share/man /usr/share/man \ + "$ROOT/man" "$ROOT/share/man" "$ETC/man" "$PLAN9/man" +do + MANPATH=$MANPATH:$dir +done +MANPATH=${MANPATH#:} + +export PATH ENV MANPATH # info diff --git a/bin/daemon b/bin/daemon diff --git a/bin/ii-log b/bin/ii-log @@ -0,0 +1,36 @@ +# split ii `out' directories to multiple files named date + +find "${IRC:-$HOME/irc}" -name out -type f | + +xargs awk -v today=`date +%Y-%m-%d` ' + +LASTNAME && FILENAME != LASTNAME { + printf("%s", out) > LASTNAME; + out = ""; +} + +FILENAME ~ /out$/ { + LASTNAME = FILENAME; + sub(/out$/, "", FILENAME); + FILENAME = FILENAME; +} + +$1 == today { + out = out $0 "\n"; +} + +$1 != today && $1 { + date = $1 + + sub(/^[^ ]* /, ""); + + while (sub(/\002/, "\033[1m")) + sub(/\002/, "\033[m"); + + print >> FILENAME date; +} + +END { + printf("%s", out) > LASTNAME; + +}' diff --git a/bin/io b/bin/io @@ -9,7 +9,8 @@ mkdir -p "$CACHE/io" # --- cache -------------------------------------------------------------------- -find "$HOME" \ +IFS=: +nohup find "$HOME" $MANPATH -type d -o -type f \ -path "$HOME/.*" -prune -o \ -path "*/.git/*" -prune -o \ -path "*/.hg/*" -prune -o \ @@ -17,6 +18,7 @@ find "$HOME" \ -path "${MAIL%/*}/*/*" -prune -o \ -type d -exec printf '%s/\n' {} + -o \ -print 2> /dev/null | sort -o "$CACHE/find" & +unset IFS # --- selection ---------------------------------------------------------------- @@ -39,9 +41,7 @@ selection="`{ grep "$MUSIC" "$CACHE/find" printf '# %s\n' man - IFS=: - find $MANPATH -name '*.[1-9]' -o -name '*.[1-9].gz' - unset IFS + grep '/man/.*\.[1-9].gz$' "$CACHE/find" printf '# %s\n' files grep '[^/]$' "$CACHE/find" diff --git a/bin/screen-brightness b/bin/screen-brightness @@ -1,3 +1 @@ -printf %s "$1" | sudo tee -a "$( - find -L /sys/class/backlight -maxdepth 2 -name brightness -)" +printf %s "$1" | sudo tee -a /sys/class/backlight/*/brightness diff --git a/bin/status b/bin/status @@ -38,14 +38,9 @@ status_cpu() status_battery() { - battery="$( - find -L /sys/class/power_supply -maxdepth 2 -name capacity \ - 2> /dev/null - )" - - if [ -f "$battery" ] + if [ -f /sys/class/power_supply/*/capacity ] then - IFS='' read -r battery < "$battery" + read -r battery < /sys/class/power_supply/*/capacity printf '%d%%' "$battery" fi } diff --git a/build/st/build b/build/st/build @@ -1,6 +1,6 @@ -sed 's/gray90/#ffeecc/' config.def.h > config.h - find "$ETC/build/st/" -name '*.diff' | xargs patch -N -p 1 -i +sed 's/gray90/#ffeecc/' config.def.h > config.h + make PREFIX="$PREFIX" install diff --git a/install b/install @@ -20,15 +20,13 @@ case "$1" in ;; ( -g ) [ $# = 1 ] || usage - mkdir -p ~/src && cd ~/src || exit + mkdir -p ~/git && cd ~/git || exit git clone http://github.com/josuah/www & git clone http://github.com/josuah/alphabet & git clone http://github.com/josuah/artisanat & - git clone http://github.com/josuah/bataille-navale & git clone http://github.com/josuah/build & git clone http://github.com/josuah/cgr & - git clone http://github.com/josuah/config & git clone http://github.com/josuah/drawille & git clone http://github.com/josuah/fungus-vs-pathogen & git clone http://github.com/josuah/hud &