dot

packages and services management
Log | Files | Refs | README

commit 02ef779885534c0feecb73f06787c283b2f31df7
parent 6f838f7f70f01ac84edb868ed5d30efc7a9c831e
Author: josuah <mail@josuah.net>
Date:   Thu, 12 Jan 2017 01:28:07 +0100

Small fixes

Diffstat:
M.local/bin/dna | 15++++++++++-----
M.local/bin/status | 8+++++++-
M.local/bin/www | 7+++----
M.local/share/build/iomenu | 2+-
M.profile | 30+++++++++++++++++++++---------
M.vim/vimrc | 1-
MREADME | 4++--
7 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/.local/bin/dna b/.local/bin/dna @@ -67,6 +67,15 @@ T="\ " +nucleotide() +{ + case "$1" in + ( A* ) printf %s "$A" ;; ( T* ) printf %s "$T" ;; + ( C* ) printf %s "$C" ;; ( G* ) printf %s "$G" ;; + esac +} + + random() ( while date +%s | md5sum | tr -cd '0-9a-f\n' | @@ -87,11 +96,7 @@ main() while [ "$1" ] do - case "$1" in - ( A* ) printf %s "$A" ;; ( T* ) printf %s "$T" ;; - ( C* ) printf %s "$C" ;; ( G* ) printf %s "$G" ;; - esac - + nucleotide "$1" set -- "${1#?}" done } diff --git a/.local/bin/status b/.local/bin/status @@ -2,7 +2,7 @@ SEPARATOR=' ' -START=' ' +START=' ' STOP=' ' @@ -58,6 +58,12 @@ status_battery() } +status_abduco() +{ + abduco | grep '^\*' | cut -d ' ' -f 3 +} + + main() { printf %s "$START" diff --git a/.local/bin/www b/.local/bin/www @@ -61,10 +61,9 @@ list() ( cd "$1" || exit 1 - find . -mindepth 1 -maxdepth 1 ! -name 'index.*' | - sort | - sed -r 's_..(.*)_<li><a href="\1">\1</a></li>_' - ) + find . -type d -mindepth 1 -maxdepth 1 ! -name 'index.*' | sort + find . -type f -mindepth 1 -maxdepth 1 ! -name 'index.*' | sort + ) | sed -r 's|./(.*)|<li><a href="\1">\1</a></li>|' printf '</ul>' } diff --git a/.local/share/build/iomenu b/.local/share/build/iomenu @@ -1,3 +1,3 @@ # Input/Output interactive menu and completion engine. -tar=http://repo.or.cz/iomenu.git/snapshot/897502eacc70cb124ff8e86a61f9a3bc4fc15986.tar.gz +tar=http://repo.or.cz/iomenu.git/snapshot/991ea73d728682256b15165743c216e4baac1255.tar.gz diff --git a/.profile b/.profile @@ -33,24 +33,33 @@ export XDG_RUNTIME_DIR="$HOME/.cache" export PS1='$( [ $? -eq 0 ] && color=2 || color=1 [ -z "${PWD##$HOME*}" ] && pwd="~${PWD#$HOME}" || pwd="$PWD" + size="$(stty size)" status="$(status)" + printf "\a" # bell printf "\033[?6c" # TTY cursor shape - printf "\a" # bell at the end of the command printf "\033]0;%s\007" "$pwd" # terminal name - printf "\n" - printf "\033[1;3%sm│\033[m %s%s\n" "$color" "$pwd" "$(git-prompt)" + # prompt line 1 + printf "\033[256H" + printf "\n\033[1;3%dm│\033[m %s%s\n" "$color" "$pwd" "$(git-prompt)" + + # status line + printf "\033[;%dH%s" "$((${size#* } - ${#status} + 1))" "$status" + + # prompt line 2 + printf "\033[256H" printf "\033[1;3%sm│\033[m " "$color" + )' -export PS2=' > ' -export PS3=' > ' +export PS2='│ ' +export PS3='│ ' # coreutils alias p='page' alias l='page ls -lhp --color' alias la='page ls -Alhp --color' -alias cl='printf "\033[H\033[2J"' +alias cl='printf "\033[$(stty size | cut -d " " -f 2)H\033[2J"' alias bh='page busybox --help' alias grep='page grep' @@ -75,7 +84,7 @@ alias lines='find . -name "*.[ch]" | xargs wc -l' page() { - "$@" | less -FR + "$@" | less -ER } @@ -167,12 +176,15 @@ screencast() main() { if [ "$TERM" = 'linux' ] - then setfont ~/.local/share/consolefonts/terminus-16n.psf + then + setfont ~/.local/share/consolefonts/terminus-16n.psf fi - [ "$ABDUCO" ] || TERM='screen' ABDUCO='dvtm' abduco -A dvtm dvtm-status + #[ "$ABDUCO" ] || TERM='screen' ABDUCO='dvtm' abduco -A dvtm dvtm-status export TERM='ansi' + + cl } diff --git a/.vim/vimrc b/.vim/vimrc @@ -38,7 +38,6 @@ set incsearch " interface set list set listchars=tab:\ \ ,trail:-,nbsp:-,extends:>,precedes:< -set scrolloff=3 set number set numberwidth=8 set cursorline diff --git a/README b/README @@ -40,11 +40,11 @@ find . -type d ! -path './.git*' -path './.*' -exec mkdir -p ~/{} \; find . -type f ! -path './.git*' -path './.*' -exec ln -sf "$PWD/{}" ~/{} \; find -L ~ -type l -exec rm {} \; -mkdir -p ~/projects "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" +mkdir -p ~/src "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" case "$1" in g | git ) - cd ~/projects || exit + cd ~/src || exit git clone ssh://repo.or.cz/iomenu.git git clone http://github.com/josuah/iode & git clone http://github.com/josuah/josuah.github.io &