dot

packages and services management
Log | Files | Refs | README

commit e02d90b20a1f3f4079c85a877eac9ac763a5f52d
parent 0729939db6763b4b5c5e9ba28ef70062a1b5aea4
Author: josuah <mail@josuah.net>
Date:   Tue, 20 Dec 2016 11:11:40 +0000

Cleanup

Diffstat:
M.config/dvtm/config.h | 2++
M.local/bin/adagio | 1-
M.local/bin/build | 16++++++++--------
M.local/bin/lightsaber | 16++++++----------
D.local/bin/lsync | 109-------------------------------------------------------------------------------
D.local/bin/music | 14--------------
D.local/bin/pipes | 146-------------------------------------------------------------------------------
M.local/bin/status | 8++++----
M.local/bin/tty-theme | 4++--
D.local/bin/version | 318-------------------------------------------------------------------------------
M.local/bin/www | 6+++---
M.local/share/build/dvtm | 1+
MREADME | 42++++++++++++++++++++++++++++++++++--------
13 files changed, 60 insertions(+), 623 deletions(-)

diff --git a/.config/dvtm/config.h b/.config/dvtm/config.h @@ -158,6 +158,8 @@ static KeyBinding bindings[] = { TAGKEYS( '1', 0) TAGKEYS( '2', 1) TAGKEYS( '3', 2) + TAGKEYS( '4', 3) + TAGKEYS( '5', 4) }; static const ColorRule colorrules[] = { diff --git a/.local/bin/adagio b/.local/bin/adagio @@ -35,7 +35,6 @@ Gb8=5920 G8=6272 Gd8=6645 Ab8=6645 A8=7040 Ad8=7459 Bb8=7459 B8=7902 # with $n the note from above, and $d the duration in millisecond. # Use '1' for silent note. -tempo='100' # 4:3 in the original score, but here, full mesure is 12. 6 mesure per line. # In addition, some "interpretation" are added, as in a performance. diff --git a/.local/bin/build b/.local/bin/build @@ -67,7 +67,7 @@ build() for file in "$CONFIG/$1/config.mk" "$CONFIG/$1/config.h" do - [ -h "$file" -o -f "$file" ] && cp -f "$file" . + [ -h "$file" ] || [ -f "$file" ] && cp -f "$file" . done [ -f ./autogen.sh ] && ./autogen.sh @@ -86,14 +86,14 @@ compile() export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export CFLAGS="-I $LOCAL/include -L$LOCAL/lib" - [ -f "$script" -o -h "$script" ] || error "$name" "no build script" + [ -f "$script" ] || [ -h "$script" ] || error "$name" "no build script" . "$script" info "$name" "installing" cd "$PREFIX" && mkdir -p bin doc etc include lib libexec share man cd src && build "$name" - cd "$PREFIX" && rmdir -p * 2> /dev/null + cd "$PREFIX" && rmdir -p ./* 2> /dev/null } @@ -102,8 +102,8 @@ download() local name="$1" tar="$2" local script="$LOCAL/share/build/$name" - [ -d "$PROGRAMS/$name/src" ] && error "$name" "already in $PROGRAMS" - [ -f "$script" -o -h "$script" ] || error "$name" "no build script" + [ -d "$PROGRAMS/$name/src" ] && error "$name" "already in $PROGRAMS" + [ -f "$script" ] || [ -h "$script" ] || error "$name" "no build script" . "$script" info "$name" "downloading" @@ -136,8 +136,8 @@ index() info "$name" "updating index in ~${LOCAL#$HOME}" cd "$PROGRAMS/$name" || exit 1 - find -type d ! -path "*/src/*" -exec mkdir -p "$LOCAL/{}" \; - find ! -type d ! -path "*/src/*" -exec ln -sf "$PWD/{}" "$LOCAL/{}" \; + find . -type d ! -path "*/src/*" -exec mkdir -p "$LOCAL/{}" \; + find . ! -type d ! -path "*/src/*" -exec ln -sf "$PWD/{}" "$LOCAL/{}" \; } @@ -183,7 +183,7 @@ main() } -main $@ +main "$@" fi diff --git a/.local/bin/lightsaber b/.local/bin/lightsaber @@ -54,15 +54,11 @@ print_handle() print_blade() { local color="$1" length="$2" - local b1=' ' - local b2='_' # foreground and background with color and bold foreground - local b3=" " for i in $(seq "$length") do sleep 0.003 - printf '\033[1;4%s;3%sm%s\033[0m' \ - "$color" "$color" "$b2" + printf '\033[1;4%s;3%sm_\033[m' "$color" "$color" done # Put cursor at the beginning of the blade @@ -73,7 +69,7 @@ print_blade() wait_button() { printf ' ' - read + read -r printf '\033[u' # reset the previous state @@ -117,12 +113,12 @@ blink_blade() close_saber() { - local length="$1" button_position="$2" + local length="$1" # ensure we are at the right position printf '\033[u' - for i in $(seq "$(($length + 3))" -1 1) + for i in $(seq "$((length + 3))" -1 1) do printf '\033[%sC\033[A' "$i" for j in 1 2 3 @@ -158,7 +154,7 @@ main() esac # close the saber while script stops - trap "close_saber '$length' 4" INT + trap 'close_saber "$length" 4' INT { print_handle '=' @@ -169,4 +165,4 @@ main() } -main $@ +main "$@" diff --git a/.local/bin/lsync b/.local/bin/lsync @@ -1,109 +0,0 @@ -# Sync two local directories. - -help=' -NAME - LSync - Mirror two local dirs keeping the latest version - -SYNOPSSIS - lsync [-v] [-e PATTERN] DIR1 ['RULE'] DIR2 - -DESCRIPTION - -e Exclude PATTERN from search, matching the whole path. - -v View the output without copying anything. - DIR The two directories to mirror. - RULE Rule to determine in which operation to perform. - > and < only copy, - >> and << copy and overwrite, - >>> and <<< only overwrite, - none means everything. - - LSync mirrors data across two directories so that both contains all the - files from each other keeping the timestapms. - - When a file exists in both directories, if they do not have the same - timestamps, the most recent file overwrite the other. - - There is no deletion performed.' - -[ $# -lt 2 ] && printf '%s\n\n' "$help" && exit 0 - -while [ $# -gt 0 ] -do case "$1" in - '-e' ) e="$2"; shift ;; - '-v' ) v=1 ;; - '>' | '>>' | '>>>' | '<<<' | '<<' | '<' ) r="$1" ;; - '-'* ) printf '%s\n\n' "$help"; exit 0 ;; - * ) [ -z "$d1" ] && d1="${1%/}" || d2="${1%/}" ;; - esac - shift -done - -[ ! -d "$d1" ] && mkdir -p "$d1" -[ ! -d "$d2" ] && mkdir -p "$d2" - -copied=0; overwritten=0; directories=0; identical=0 - -# Generate a path list for all the files from both directories -{ - find "$d1" | cut -c $((${#d1} + 1))- - find "$d2" | cut -c $((${#d2} + 1))- -} | sort -u | { - [ -z "$e" ] && tee || grep -v "$e" -} | { - while read -r path - do - # Create directories - if [ -d "$d1/$path" ] || [ -d "$d2/$path" ] - then [ -z "$v" ] && mkdir -p "$d1/$path" "$d2/$path" - printf '\033[1;30m ' - directories=$(($directories + 1)) - - # Copy files that does not exist on one side - elif [ ! -e "$d2/$path" ] - then if [ "$r" = '>' -o "$r" = '>>' -o -z "$r" ] - then b=';1' copied=$(($copied + 1)) - [ -z "$v" ] && cp -p "$d1/$path" "$d2/$path" - fi - printf '\033[32%sm1 > 2\033[0%sm' "$b" "$b" - - elif [ ! -e "$d1/$path" ] - then if [ "$r" = '<' -o "$r" = '<<' -o -z "$r" ] - then b=';1' copied=$(($copied + 1)) - [ -z "$v" ] && cp -p "$d2/$path" "$d1/$path" - fi - printf '\033[32%sm1 < 2\033[0%sm' "$b" "$b" - - # Compare both file to check if identical - elif cmp -s "$d1/$path" "$d2/$path" - then identical=$(($identical + 1)) - printf '1 = 2' - - # Overwrite files keeping the latest version - elif [ "$d1/$path" -nt "$d2/$path" ] - then if [ "$r" = '>>>' -o "$r" = '>>' -o -z "$r" ] - then b=';1' overwritten=$(($overwritten + 1)) - [ -z "$v" ] && cp -pf "$d1/$path" "$d2/$path" - fi - printf '\033[31%sm1>>>2\033[0%sm' "$b" "$b" - - elif [ "$d2/$path" -nt "$d1/$path" ] - then if [ "$r" = '<<<' -o "$r" = '<<' -o -z "$r" ] - then b=';1' overwritten=$(($overwritten + 1)) - [ -z "$v" ] && cp -pf "$d2/$path" "$d1/$path" - fi - printf '\033[31%sm1<<<2\033[0%sm' "$b" "$b" - fi - - unset b - printf ' %s\033[0m\n' "$path" - done - - printf ' \ \ %-40s \033[1;32m%5s\033[0m copied - \ \__ %-40s \033[1;31m%5s\033[0m overwritten - \_____ %-40s \033[1;39m%5s\033[0m identical - %-40s \033[1;30m%5s\033[0m directories\n' \ - '' "$copied" \ - "$d2" "$overwritten" \ - "$d1" "$identical" \ - '' "$directories" -} diff --git a/.local/bin/music b/.local/bin/music @@ -1,14 +0,0 @@ -# Prompt for a music to play with mplayer -# -# |\/| _ . _ -# | | |_| _\ | (_ -# -#_______________________________________________________________________________ - -cd "$HOME/Music" - -find . -mindepth 1 -type f -follow | sort | iomenu -l 200 | - while IFS='' read -r track - do - [ -f "$track" ] && mplayer "$track" - done diff --git a/.local/bin/pipes b/.local/bin/pipes @@ -1,146 +0,0 @@ -#!/usr/bin/env bash -# pipes.sh: Animated pipes terminal screensaver. -# Copyleft (ↄ) 2015 - Acidhub <acidhub@craft.net.br> -# 2015 - Pipeseroni - http://github.com/pipeseroni -# 2014 - Yu-Jie Lin <livibetter@gmail.com> -# ???? - Mathew Simpson -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - -VERSION=1.2 - -M=32768 -p=3 -f=75 s=13 r=2000 t=0 -w=80 h=24 - -resize() { - w=$(tput cols) h=$(tput lines) -} - -# ab -> idx = a*4 + b -# 0: up, 1: right, 2: down, 3: left -# 00 means going up , then going up -> ┃ -# 12 means going right, then going down -> ┓ -sets=( - "┃┏ ┓┛━┓ ┗┃┛┗ ┏━" # -t 0 "default" - "│╭ ╮╯─╮ ╰│╯╰ ╭─" # -t 1 "round" - "│┌ ┐┘─┐ └│┘└ ┌─" # -t 2 "weak" - "║╔ ╗╝═╗ ╚║╝╚ ╔═" # -t 3 "double" - "|+ ++-+ +|++ +-" # -t 4 "add/sub" - "|/ \/-\ \|/\ /-" # -t 5 "It' something" - ".. .... .... .." # -t 6 "dots" - ".o oo.o o.oo o." # -t 7 "dot-O" - "-\ /\|/ /-\/ \|" # -t 8 "railway" - "▓≡▓≡≡▓≡ ≡▓≡≡▓≡▓" # -t 9 "blocks" -) -v=() -RNDSTART=0 -BOLD=1 -NOCOLOR=0 - -OPTIND=1 -while getopts "p:t:f:s:r:RBChv" arg; do -case $arg in - p) ((p=(OPTARG>0)?OPTARG:p));; - t) - if [[ "$OPTARG" = c???????????????? ]]; then - V+=(${#sets[@]}) - sets+=("${OPTARG:1}") - else - ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG) - fi - ;; - f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));; - s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));; - r) ((r=(OPTARG>=0)?OPTARG:r));; - R) RNDSTART=1;; - B) BOLD=0;; - C) NOCOLOR=1;; - h) echo -e "Usage: $(basename $0) [OPTION]..." - echo -e "Animated pipes terminal screensaver.\n" - echo -e " -p [1-?]\tnumber of pipes (D=3)." - echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)." - echo -e " -t c[16 chars]\tcustom type of pipes." - echo -e " -f [20-100]\tframerate (D=75)." - echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." - echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)." - echo -e " -R \t\trandom starting point." - echo -e " -B \t\tno bold effect." - echo -e " -C \t\tno color." - echo -e " -h\t\thelp (this screen)." - echo -e " -v\t\tprint version number.\n" - exit 0;; - v) echo "$(basename -- "$0") $VERSION" - exit 0 - esac -done - -# set default values if not by options -((${#V[@]})) || V=(0) - -cleanup() { - # clear up standard input - read -t 0.001 && cat </dev/stdin>/dev/null - - tput rmcup - tput cnorm - stty sane - echo -ne '\033[0m' - exit 0 -} -trap resize SIGWINCH -trap cleanup HUP TERM -trap 'break 2' INT - -resize - -for (( i=1; i<=p; i++ )); do - c[i]=$((i%8)) n[i]=0 l[i]=0 - ((x[i]=RNDSTART==1?RANDOM*w/32768:w/2)) - ((y[i]=RNDSTART==1?RANDOM*h/32768:h/2)) - v[i]=${V[${#V[@]} * RANDOM / M]} -done - -stty -echo -tput civis -tput clear -# any key press exits the loop and this script -while REPLY=; read -t 0.0$((1000/f)) -n 1; [[ -z $REPLY ]] ; do - for (( i=1; i<=p; i++ )); do - # New position: - ((${l[i]}%2)) && ((x[i]+=-${l[i]}+2,1)) || ((y[i]+=${l[i]}-1)) - - # Loop on edges (change color on loop): - ((${x[i]}>w||${x[i]}<0||${y[i]}>h||${y[i]}<0)) && ((c[i]=RANDOM%8, v[i]=V[${#V[@]}*RANDOM/M])) - ((x[i]=(x[i]+w)%w)) - ((y[i]=(y[i]+h)%h)) - - # New random direction: - ((n[i]=RANDOM%s-1)) - ((n[i]=(${n[i]}>1||${n[i]}==0)?${l[i]}:${l[i]}+${n[i]})) - ((n[i]=(${n[i]}<0)?3:${n[i]}%4)) - - # Print: - tput cup ${y[i]} ${x[i]} - echo -ne "\e[${BOLD}m" - [[ $NOCOLOR == 0 ]] && echo -ne "\e[3${c[i]}m" - echo -n "${sets[v[i]]:l[i]*4+n[i]:1}" - l[i]=${n[i]} - done - ((r>0 && t*p>=r)) && tput civis && t=0 || ((t++)) -done - -cleanup diff --git a/.local/bin/status b/.local/bin/status @@ -20,7 +20,7 @@ status_mail() if [ -d "$MAIL/new" ] then - mail="$(ls "$MAIL/new" | wc -l)" + mail="$(find "$MAIL/new" -type f | wc -l)" mail="${mail#0}" mail="${mail:+$mail mail}" @@ -49,7 +49,7 @@ status_date() # status_cpu() { - read latest_1 latest_5 latest_15 trailing < /proc/loadavg + read -r latest_1 latest_5 latest_15 trailing < /proc/loadavg printf '%s %s %s' "$latest_1" "$latest_5" "$latest_15" } @@ -81,7 +81,7 @@ main() printf %s "$segment" - [ "$segment" -a $# -gt 1 ] && printf "$SEPARATOR" + [ "$segment" ] && [ $# -gt 1 ] && printf %s "$SEPARATOR" shift done @@ -89,4 +89,4 @@ main() } -main ${@:-mail abduco cpu battery date} +[ $# -gt 0 ] main "$@" || main mail abduco cpu battery date diff --git a/.local/bin/tty-theme b/.local/bin/tty-theme @@ -296,7 +296,7 @@ F ffffff theme() { - local number="$1" show=0 i=0 + number="$1" show=0 i=0 printf '\033[H\033[J' @@ -334,7 +334,7 @@ if [ -z "$1" ] then theme printf '\033]P0000000\033]P7aaaaaa\033[J\n Theme number: ' - read number + read -r number else number="$1" fi diff --git a/.local/bin/version b/.local/bin/version @@ -1,318 +0,0 @@ -DIR='.version' - - -usage() -{ - printf '%s\n' "Usage: version OPTION COMMAND - -OPTION - none for now - -COMMAND - n, new - Create a new revision if something changed - - i, init - Make the current directory a version directory by creating - the \"$DIR\" directory. - - s, status - Print modification status of current directory - - m, merge DIR - Update the status of the current project and of DIR - comparing them in both ways. Then, proceed to file - copies to have both directories with the same versions. -" -} - - -info() -{ - local color="$1" message="$2" - - printf '%s: \033[1;3%sm%s\033[0m\n' "${0##*/}" "$color" "$message" 1>&2 -} - - -die() -{ - info 1 "$1" - exit 1 -} - - -# -# Go to the root directory of a project if any, or return error. -# -go_to_root() -{ - # go to root directory of project - while [ ! -d "$DIR" ] - do - [ "$(pwd)" = '/' ] && return 1 # error - cd .. - done - - return 0 # success -} - - -# -# Generate the md5sums for all targeted files of one repository. -# -md5sums() -{ - find . -type f ! -path "./.git/*" ! -path "./$DIR/*" -print0 | - xargs -0 md5sum -} - - -# -# Create a new revision if something changed, then return success. -# -new_version() -{ - local current="$(mktemp)" date="$(date +'%0Y-%0m-%0d-%0H-%0M-%0S')" - - # generate the md5sums - md5sums > "$current" - - local md5="$(md5sum "$current" | cut -c 1-32)" - local last="$(ls "$DIR" | sort | tail -n 1)" - - if [ -z "${last%%*-$md5}" -a -f "$DIR/$last" ] - then - rm "$current" - die "nothing changed since \"$last\"" - else - info 7 "new revision $md5" - mv "$current" "$DIR/$date-$md5" - fi - - return 0 -} - - -# -# Create a new revision of the project. -# -init() -{ - mkdir -p "$DIR" -} - - -# -# Get the list of revision that ocuured since one particular revision. -# -history() -{ - local md5="$1" - - # sort revisions by date - ls "$DIR" | sort -r | while IFS='-' read -r y m d H M S sum - do - [ "$md5" = "$sum" ] && return - - # rebuild the name - printf '%s-' "$y" "$m" "$d" "$H" "$M" "$S" - printf '%s\n' "$sum" - done | tac -} - - -# -# Follows every change a file had since a revision and print the history. -# -# The changes can be either: -# -# - c, creation -# -# - d, deletion -# -# - m, modification -# -# - r, rename -# -# - x, did not exist -# -# - e, equal to some version in "$destination" -# -# It look at every changes of the file described from "$md5" and "$path" -# backward in history from "$revision", until either: -# -# - the md5 and path match any revision of a file in the other tree, -# -# - a creation of this file -# -trace() -{ - local md5="$1" path="$2" revision="$3" destination="$4" - - : -} - - -# -# Take decision and perform actions according to an input feed from trace -# -action() -{ - # source: c > m? > . - # destination: - # - # If the file is created in source and never existed in - # destination, create it as well, create it on the other side as - # well - - # source: e > m - # destination: e > d - # - # If the file was deleted on source, but modified since in - # destination, prompt the user if he wants to copy the modified - # file from the destination branch. - - # source: e > m - # destination: e - # - # If the file has been modified on source but not in dest, prompt - # the user which version he wants to keep. - - # source: c > m? - # destination: - # - # If the file has only been created in source, and never existed in - # destination, just copy it to dest -} - - -# -# Compare current and foreign trees, pull the changes to both, trying to -# merge correctly the difference. -# -merge() -{ - local tree1="$(go_to_root; pwd)" - local tree2="$(cd "$1"; go_to_root; pwd)" - - local revision1="$tree1/$DIR/$(ls "$tree1/$DIR" | tail -n 1)" - local revision2="$tree2/$DIR/$(ls "$tree2/$DIR" | tail -n 1)" - - # all the files that differ across the two trees at their latest version - { - sed 's/^/1 /' "$revision1" - sed 's/^/2 /' "$revision2" - } | sort -k 2 | uniq -w 2 -u | while read -r revision md5 path - do - # we will want to get the file from source into destination - 1 ) local source="$tree1" destination="$tree2" ;; - 2 ) local source="$tree2" destination="$tree1" ;; - esac - - # if only one of the two version, then immediately import the - # other one, that's it - - # get the history of change of the source file - trace "$source/$DIR/$revision" "$md5" "$path" | action - -# # for this entry, look the similar version in the other tree -# #IFS='- :' read -r sum path -# ls "$tree/$DIR" | # for all revisions -# sort -r | -# xargs grep -h "$sum $path" "$tree/$DIR" | -# head -n 1 | -# { -# read -r sum file -# } -# -# # since this revision look for what happen in history -# ( -# cd "$tree" -# history "${revision##*-}" -# ) - done -} - - -# -# Display changes since latest revision -# -status() -{ - local latest="$(ls "$DIR" | tail -n 1)" - - # list all different files between current state and latest state - md5sums | cat - "$DIR/$latest" | sort -k 2 | uniq -u | uniq -f 1 | - while read -r md5 path - do - if [ -f "$path" ] && cut -c 35- "$DIR/$latest" | - grep -x -F "$path" > /dev/null - then - info 3 "~ $path" - elif [ -f "$path" ] - then - info 2 "+ $path" - else - info 1 "- $path" - fi - done -} - - -main() -{ - case "$1" in - n | new ) - if go_to_root - then - new_version - else - die "no \"$DIR\" found in tree" - fi - ;; - i | init ) - if (go_to_root) - then - die "already one \"$DIR\" in tree" - else - init - fi - ;; - s | status ) - if go_to_root - then - status - else - die "no \"$DIR\" found in tree" - fi - ;; - m | merge ) - if [ -d "$2" ] - then - if (go_to_root) && (cd "$2" && go_to_root) - then - merge "$2" - else - die "no \"$DIR\" found in tree" - fi - else - die "\"$2\" not a directory" - fi - ;; - h | history ) - if go_to_root - then - history "$2" - else - die "no \"$DIR\" found in tree" - fi - ;; - '' | * ) - usage - ;; - esac -} - - -main $@ diff --git a/.local/bin/www b/.local/bin/www @@ -59,7 +59,7 @@ list() printf '<ul>\n' ( # for cd not to affect current directory - cd "$dir" + cd "$dir" || exit find . -mindepth 1 -maxdepth 1 ! -name 'index.*' | sort | sed -r 's_..(.*)_<li><a href="\1">\1</a></li>_' @@ -82,7 +82,7 @@ nav() main() { - if [ "$#" -gt 0 ] || [ ! -f layout.html ] + if [ ! -f layout.html ] then printf '%s: no "%s" file in "%s"\n' "${0##*/}" "$LAYOUT" "$PWD" exit 1 @@ -95,4 +95,4 @@ main() done } -main $@ +main "$@" diff --git a/.local/share/build/dvtm b/.local/share/build/dvtm @@ -4,6 +4,7 @@ tar=http://github.com/martanne/dvtm/archive/master.tar.gz build() { + cp ~/.config/dvtm/config.h config.h cp ~/.config/dvtm/dvtm-status dvtm-status make PREFIX="$PREFIX" install } diff --git a/README b/README @@ -6,17 +6,42 @@ ________________________________________________________________________________ Configuration files for all UNIX distros, shell agnostic. - Scripts are in .local/bin - - There is a package manager, that build to download, compile, - and install packages in ~/programs/<program_name>, and setup - symlinks to .local/ as a local root directory. + I have no C++ in this repo and much more shell scripts. GitHub is + not detecting all source types accurately for C headers and shell + script without shebangs. This file is the installer script. You can run it.' + +scripts (/bin) +________________________________________________________________________________ + + Scripts are in ./.local/bin. I wrote them to be compatible with + any shell, and but for the shebang (android breaks everything). + + build + Package manager that downloads, compiles, and installs + packages in ~/programs/<program_name>, and setup symlinks + to .local/ as a local root directory. + + fig1, fig2 + Single-file figlet implementation, with built-in fonts. + + git-prompt + Simple awk script to display git information in the prompt, + + blawk, drawk + Represent an image with text characters either braille or + quadrants. + + +configuration files (/etc) + + + cd "${0%/*}" || exit 1 -find -type d ! -path './.git*' -path './.*' -exec mkdir -p ~/{} \; -find -type f ! -path './.git*' -path './.*' -exec ln -sf "$PWD/{}" ~/{} \; +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" @@ -37,7 +62,8 @@ g | git ) ;; m | mail ) - read -p '<address@mail.net> <imap.host.net> <password>:' a h p + printf '<address@mail.net> <imap.host.net> <password>:' + read -r a h p printf 'machine %s\nlogin %s\npassword "%s"' "$h" "$a" "$p" > ~/.netrc printf '\033[A\r\033[K' chmod 400 "$HOME/.netrc"