dot

packages and services management
Log | Files | Refs | README

commit 8e441ea3fc096306cfec728d6f1855ca153c08bc
parent ddc027bdb1bf69d78601e12802f018464e4171dd
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Fri,  2 Jun 2017 20:50:07 +0200

m

Diffstat:
M.profile | 142++++++++++++++++---------------------------------------------------------------
Aalias | 27+++++++++++++++++++++++++++
Mbuild | 41++++++++++++++++-------------------------
Advtm/profile | 1+
Amblaze/build | 1+
Mplan9port/profile | 7+++----
Aprofile | 33+++++++++++++++++++++++++++++++++
7 files changed, 110 insertions(+), 142 deletions(-)

diff --git a/.profile b/.profile @@ -1,127 +1,43 @@ -# plan 9 - -PLAN9="$HOME/9" - -export PLAN9 - - # build packages -OPT="$HOME/opt" -SRC="$HOME/src" -ETC="$HOME/etc" -ROOT="$HOME/.local" - -export OPT SRC ETC VAR BIN ROOT +export ROOT="$HOME/.local" +export OPT="$HOME/opt" +export SRC="$HOME/src" +export ETC="$HOME/etc" +export GIT="$HOME/git" +export VAR="$HOME/var" -# data paths - -GIT="$HOME/git" -IRC="$HOME/var/irc" -MAIL="$HOME/var/mail/INBOX" -MUSIC="$HOME/music" - -export GIT IRC MAIL MUSIC +export IRC="$VAR/irc" +export MAIL="$VAR/mail/INBOX" +export MUSIC="$VAR/music" # libraries -LIBPATH="$ROOT/lib:$LIBPATH" -LD_RUN_PATH="$ROOT/lib:$LD_RUN_PATH" -LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" - -export LIBPATH LD_RUN_PATH LD_LIBRARY_PATH +export PATH="$ROOT/bin:$PATH" +export LIBPATH="$ROOT/lib:$LIBPATH" +export MANPATH="$MANPATH:/man:/share/man:/usr/share/man:$ROOT/man" +export LD_RUN_PATH="$ROOT/lib:$LD_RUN_PATH" +export LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" -# system paths +# deduplicate variables -ENV="$HOME/.profile" -PATH="$( - printf %s "$ETC/bin:$ROOT/bin:$PATH:$PLAN9/bin" | +export PATH=$( + printf %s "$PATH" | awk -v RS=':' -v ORS=':' '!path[$0] { path[$0] = 1; print; }' | sed 's/:$//' -)" -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 - -NAME='Josuah Demangeon' -NICK='josuah' -EMAIL='mail@josuah.net' -TZ='Europe/Paris' - -export NAME NICK EMAIL TZ - - -# default commands - -EDITOR='mg' -VISUAL='mg' -PAGER='less' -MANPAGER='less' -DVTM_PAGER='less -R' -BROWSER='firefox' - -export EDITOR VISUAL PAGER MANPAGER DVTM_PAGER BROWSER - - -TERM=vt200 - -export TERM - - -# prompts - -PS1='`prompt $?`' -PS2=' ' -PS3=' ' - -export PS1 PS2 PS3 - - -# startup - -case "$(tty)" in ( /dev/tty* ) - setfont "$ETC/consolefonts/lode-16.psf" - printf '\033]P0000000\033]P7ffddaa\033[J' # color theme - ;; -esac - - -# core - -alias l='ls -lp' -alias la='ls -lpA' -alias cl='printf "\033[H\033[2J"' - - -# iomenu - -alias j='fg "%`jobs | iomenu | sed -r "s/.([0-9]*).*/\1/"`"' -alias f='find . ! -path "*/.git/*" -type f | iomenu -p file' -alias d='find . ! -path "*/.git/*" -type d | iomenu -p directory' -alias c='cd "$(find "$HOME" -type d | sort | iomenu -p cd)"' -alias p='p=`io-ps`' - - -# utilities +) +export MANPATH=$( + printf %s "$MANPATH" | + awk -v RS=':' -v ORS=':' '!path[$0] { path[$0] = 1; print; }' | + sed 's/:$//' +) -alias myip='curl icanhazip.com' -alias ix='curl -F "f:1=<-" ix.io' -alias w1r3='curl -F upload=@- https://w1r3.net' -alias wttr='wget -qO- wttr.in' -alias lines='find . -name "*.[ch]" | xargs wc -l | sort -n' -alias count='echo "$(( - $(git diff | grep "^+" | wc -l) - - $(git diff | grep "^-" | wc -l) -))"' +while IFS='' read -r profile +do + . "$profile" +done << EOF +$(find "$ETC" -type f -name profile) +EOF diff --git a/alias b/alias @@ -0,0 +1,27 @@ +# core + +alias l='ls -lp' +alias la='ls -lpA' +alias cl='printf "\033[H\033[2J"' + + +# iomenu + +alias j='fg "%`jobs | iomenu | sed -r "s/.([0-9]*).*/\1/"`"' +alias f='find . ! -path "*/.git/*" -type f | iomenu -p file' +alias d='find . ! -path "*/.git/*" -type d | iomenu -p directory' +alias c='cd "$(find "$HOME" -type d | sort | iomenu -p cd)"' +alias p='p=`io-ps`' + + +# utilities + +alias myip='curl icanhazip.com' +alias ix='curl -F "f:1=<-" ix.io' +alias w1r3='curl -F upload=@- https://w1r3.net' +alias wttr='wget -qO- wttr.in' +alias lines='find . -name "*.[ch]" | xargs wc -l | sort -n' +alias count='echo "$(( + $(git diff | grep "^+" | wc -l) - + $(git diff | grep "^-" | wc -l) +))"' diff --git a/build b/build @@ -1,13 +1,6 @@ # Install sources from build receipes -usage() -{ - printf 'build [-d pkg] [-r pkg] [-i pkg] [-u pkg]\n' - exit 1 -} - - build() { find "$ETC/$1" -name '*.diff' -exec patch -N -p 1 -i {} \; @@ -15,7 +8,7 @@ build() [ -f ./configure ] && ./configure --prefix="$PREFIX" - make && make PREFIX="$PREFIX" DESTDIR="$PREFIX" install clean + make && make PREFIX="$PREFIX" install clean } @@ -44,7 +37,7 @@ download() { read url < "$ETC/$1/url" - [ -e "$SRC/$1" ] && echo "'$1' already in $SRC" exit 1 + [ -e "$SRC/$1" ] && return 0 [ -e "$OPT/$1" ] && rm -r "$OPT/$1" case "$url" in @@ -78,25 +71,23 @@ index() } +usage() +{ + echo 'build [-d pkg] [-r pkg] [-i pkg] [-u pkg]' + exit 1 +} + + main() { + [ $# = 2 ] || usage + case "$1" in - -d ) [ $# = 2 ] || usage - download "$2" && index "$2" - ;; - -i ) [ $# = 2 ] || usage - [ ! -d "$OPT/$2" ] && download "$2" - compile "$2" && index "$2" - ;; - -r ) [ $# = 2 ] || usage - remove "$2" - ;; - -u ) [ $# = 2 ] || usage - remove "$2" - download "$2" && compile "$2" && index "$2" - ;; - * | '' ) usage - ;; + ( -r ) remove "$2" ;; + ( -d ) download "$2" && index "$2" ;; + ( -i ) download "$2" && compile "$2" && index "$2" ;; + ( -u ) remove "$2"&& download "$2" && compile "$2" && index "$2" ;; + ( * ) usage ;; esac } diff --git a/dvtm/profile b/dvtm/profile @@ -0,0 +1 @@ +export DVTM_PAGER='less -R' diff --git a/mblaze/build b/mblaze/build @@ -0,0 +1 @@ +gmake diff --git a/plan9port/profile b/plan9port/profile @@ -1,4 +1,3 @@ -PLAN9=$OPT/plan9port -PATH=$PLAN9/bin:$PATH - -export PLAN9 PATH +export PLAN9="$SRC/plan9port" +export PATH="$PLAN9/bin:$PATH" +export MANPATH="$PLAN9/man:$MANPATH" diff --git a/profile b/profile @@ -0,0 +1,33 @@ +# info + +export NAME='Josuah Demangeon' +export NICK='josuah' +export EMAIL='mail@josuah.net' +export TZ='Europe/Paris' + + +# default commands + +export EDITOR='mg' +export VISUAL='mg' +export PAGER='less' +export MANPAGER='less' +export BROWSER='firefox' + +export TERM=vt200 + + +# prompts + +export PS1='$(prompt $?)' +export PS2=' ' +export PS3=' ' + + +# startup + +case "$(tty)" in ( /dev/tty* ) + setfont "$ETC/consolefonts/lode-16.psf" + printf '\033]P0000000\033]P7ffddaa\033[J' # color theme + ;; +esac