dot

packages and services management
Log | Files | Refs | README

commit 521086fc7ff285d2837b2822f86013a603fe58d6
parent da11a840712269bfd10ef0753631dea79ca75b4e
Author: josuah <mail@josuah.net>
Date:   Tue, 25 Oct 2016 12:48:01 -0400

Added ii and utf library

Diffstat:
ABUILD/ii | 3+++
ABUILD/libutf | 3+++
Mbin/irc | 21++++++++++-----------
Mshell/.config/shell/environment | 9+++++----
4 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/BUILD/ii b/BUILD/ii @@ -0,0 +1,3 @@ +# IRC-it, a FIFO-based irc client + +tar=http://git.suckless.org/ii/snapshot/ii-714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456.tar.gz diff --git a/BUILD/libutf b/BUILD/libutf @@ -0,0 +1,3 @@ +# Plan 9 compatible C89 UTF-8 library + +tar=http://github.com/cls/libutf/archive/master.tar.gz diff --git a/bin/irc b/bin/irc @@ -193,8 +193,8 @@ parse_message() grep -l -r "$nick" | while read chan do chan="${chan#$srv/}" - print_msg "$nick" "$trail" "$cmd" "$srv" "$chan" \ - >> "$srv/$chan" + print_msg "$nick" "$trail" "$cmd" "$srv" "$chan" >> \ + "$srv/$chan" done ;; *) @@ -229,22 +229,21 @@ print_msg() # Single line separator at the right place. - for n in $(tac "$srv/$chan" | cut -c 1-$NICK_LEN) - do last_nick="$n"; break - done - + last_nick="$(tail -n 1 "$srv/$chan" | cut -c 1-$NICK_LEN)" + last_nick="${last_nick## *}" + last_nick="${last_nick%% *}" last_cmd="$(tail -n 1 "$srv/$chan" | cut -c $(($NICK_LEN + 2))-)" last_cmd="${last_cmd%% *}" - if [ "$cmd" = '|' ] \ - && [ "$last_nick" != "$nick" ] \ - || [ "$cmd" != "$last_cmd" ] + if [ "$cmd" = '|' ] && + [ "$last_nick" != "$nick" ] || + [ "$cmd" != "$last_cmd" ] then printf "%${NICK_LEN}s |\n" fi # Print the message - printf '%s\n' "$trail" | fold -s -w $((80 - $NICK_LEN - ${#cmd})) \ - | while read line + printf '%s\n' "$trail" | fold -s -w $((80 - $NICK_LEN - ${#cmd})) | + while read line do printf "%${NICK_LEN}s %1s %s\n" "$nick" "$cmd" "$line" nick='' diff --git a/shell/.config/shell/environment b/shell/.config/shell/environment @@ -28,12 +28,12 @@ export DVTM_EDITOR="$PAGER" export PROGRAMS="$HOME/Programs" export CONFIG="$HOME/Config" -export LOCAL="$HOME/.local" export MAIL="$HOME/Mail/INBOX" export ENV="$HOME/.profile" -export XDG_CONFIG_HOME="$HOME/.config" # If it is not set by default. -export XDG_CACHE_HOME="$HOME/.cache" +export LOCAL="$HOME/.local" export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" # PATHS @@ -43,5 +43,6 @@ export PATH="$LOCAL/bin/$dir:$PATH" export PATH="$LOCAL/bin:$CONFIG/bin:$PATH" export CPATH="$LOCAL/include:$CPATH" export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" -export LD_RUN_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" +export LIBPATH="$LOCAL/lib:$LIBPATH" +export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH"