dot

packages and services management
Log | Files | Refs | README

commit e3b1ca2851b80d16b653a944f10208439506a60f
parent 02ef779885534c0feecb73f06787c283b2f31df7
Author: josuah <mail@josuah.net>
Date:   Sun, 15 Jan 2017 18:31:23 +0100

Fixed www a bit

Diffstat:
M.local/bin/build | 3++-
M.local/bin/status | 11++---------
M.local/bin/version | 2+-
M.local/bin/www | 13++++++-------
M.profile | 24+++++-------------------
5 files changed, 16 insertions(+), 37 deletions(-)

diff --git a/.local/bin/build b/.local/bin/build @@ -160,7 +160,8 @@ main() ;; l | link ) find "$PROGRAMS" -maxdepth 1 -mindepth 1 | while IFS='' read -r name - do index "${name#$PROGRAMS}" + do + index "${name#$PROGRAMS}" done ;; v | view ) diff --git a/.local/bin/status b/.local/bin/status @@ -22,13 +22,6 @@ status_mail() } -status_abduco() -{ - buffers="$(($(abduco | wc -l) - 1))" - [ "$buffers" -gt 0 ] && printf '[%s]' "$buffers" -} - - status_date() { date +'%Y-%m-%d %H:%M' @@ -60,7 +53,7 @@ status_battery() status_abduco() { - abduco | grep '^\*' | cut -d ' ' -f 3 + abduco | grep '^\*' | cut -d ' ' -f 3 | head -n 1 } @@ -80,4 +73,4 @@ main() } -[ $# -gt 0 ] && main "$@" || main mail abduco cpu battery date +[ $# -gt 0 ] && main "$@" || main mail cpu battery date diff --git a/.local/bin/version b/.local/bin/version @@ -169,7 +169,7 @@ main() case "$1" in ( i | init ) - [ $# -ne 1 ] || usage i + [ $# -eq 1 ] || usage i init ;; diff --git a/.local/bin/www b/.local/bin/www @@ -21,7 +21,7 @@ parse() # execute the keyword action and print its output case "${2%%\}\}*}" in - *content* ) + *content* ) : [ -f "$1/index.txt" ] && cat "$1/index.txt" ;; @@ -73,9 +73,8 @@ list() nav() { - find . -mindepth 1 -maxdepth 1 -type d ! -path '*/.*' | - sort | - sed -r 's_..(.*)_| <a href="{{ root }}/\1">\1</a>_' + find . -mindepth 1 -maxdepth 1 -type d ! -path '*/.*' | sort | + sed -r 's_..(.*)_| <a href="{{ root }}/\1">\1</a>_' } @@ -89,9 +88,9 @@ main() # create index.html pages for each non-dotfile directory find . ! -path '*/.*' -type d | while IFS='' read -r d - do - parse "${d#./}" "$(cat "$LAYOUT")" > "$d/index.html" - done + do + parse "${d#./}" "$(cat "$LAYOUT")" > "$d/index.html" + done } diff --git a/.profile b/.profile @@ -8,6 +8,7 @@ . ~/.local/bin/build export ENV="$HOME/.profile" +export TERM='ansi' export TZ='Europe/Paris' # mail @@ -33,21 +34,12 @@ 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 "\033]0;%s\007" "$pwd" # terminal name - # 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" )' @@ -59,7 +51,7 @@ export PS3='│ ' alias p='page' alias l='page ls -lhp --color' alias la='page ls -Alhp --color' -alias cl='printf "\033[$(stty size | cut -d " " -f 2)H\033[2J"' +alias cl='printf "\033[H\033[2J"' alias bh='page busybox --help' alias grep='page grep' @@ -175,16 +167,10 @@ screencast() main() { - if [ "$TERM" = 'linux' ] - then - setfont ~/.local/share/consolefonts/terminus-16n.psf - fi - - #[ "$ABDUCO" ] || TERM='screen' ABDUCO='dvtm' abduco -A dvtm dvtm-status - - export TERM='ansi' + [ "$TERM" = 'linux' ] && + setfont ~/.local/share/consolefonts/terminus-16n.psf - cl + [ "$ABDUCO" ] || ABDUCO='main' TERM='screen' abduco -A main dvtm-status }