dotfiles

configuration files
git clone https://pi.duncano.de/git/dotfiles.git
Log | Files | Refs | README

commit 3694014ac8ce76023c06c69b562a7addf69aa355
parent af363d10381831bef8ac3f24ab86e3243a9493b1
Author: Duncaen <mail@duncano.de>
Date:   Thu,  2 Jul 2015 09:38:54 +0200

move z to my fork

Diffstat:
.gitmodules | 2+-
bin/s | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++------
bin/venv | 11++++++++---
notes.md | 1+
profile | 6+++++-
service/x | 4++--
sv/syncthing/run | 2+-
vimrc | 1+
xinitrc | 2+-
z | 2+-
10 files changed, 76 insertions(+), 16 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -1,3 +1,3 @@ [submodule "z"] path = z - url = git@github.com:rupa/z.git + url = git@github.com:duncaen/z.git diff --git a/bin/s b/bin/s @@ -1,23 +1,23 @@ #!/usr/bin/mksh fatal() { - msg "FATAL: $1" + msg "$@" >&2 exit 1 } msg() { - printf "$1\n" + printf "$@" } sv_enable() { - [ ! -e "${SVDIR}${1}" ] && fatal "service '${1}' not found." - [ -e "${SERVICEDIR}${1}" ] && fatal "service '${1}' already enabled." + [ ! -e "${SVDIR}${1}" ] && fatal "service '${1}' not found.\n" + [ -e "${SERVICEDIR}${1}" ] && fatal "service '${1}' already enabled.\n" ln -sfv "${SVDIR}${1}" "${SERVICEDIR}${1}" } sv_disable() { [ ! -e "${SVDIR}${1}" ] && fatal "service '${1}' not found." - [ ! -e "${SERVICEDIR}${1}" ] && fatal "service '${1}' already disabled." + [ ! -e "${SERVICEDIR}${1}" ] && fatal "service '${1}' already disabled.\n" rm -rfv "${SERVICEDIR}${1}" } @@ -25,9 +25,56 @@ sv_list() { sv s "${SERVICEDIR}"* } -while getopts "u:v" opt; do +sv_deps() { + for service in "$@"; do + # TODO: check if service exists + case $(cat "${SVDIR}${service}/supervise/stat") in + run*) + /home/duncan/bin/s check "${service}" >/dev/null || wait+=" $service" + ;; + down*) + /home/duncan/bin/s u "${service}" >/dev/null && wait+=" $service" + ;; + esac + done + [ -z "$wait" ] || fatal "wait for dependencies:$wait.\n" + exit 0 +} + +sv_tree() { + services=$(ls -1 "$1" 2>/dev/null) + [ "$?" -ne "0" ] && return 1 + + set -A tree + + for f in ${services}; do + for b in $(ls -1 "${SVDIR}${f}/before" 2> /dev/null); do + echo "$b>$f" + before="$before$b:$f\n" + done + for a in $(ls -1 "${SVDIR}${f}/after" 2> /dev/null); do + echo "$f<$a" + after="$after$a:$f\n" + done + done + + for f in ${services}; do + echo "$f;" + for a in $(echo "$after" | grep "$f"'$'); do + echo "$f--$a" + after=$(echo "$after" | sed 's/^://g') + done + done + + echo "before:\n$before" + echo "after:\n$after" + +} + +while getopts "u:w:v" opt; do case "$opt" in u) SVUSER="$OPTARG" ;; + w) export SVWAIT="$OPTARG" ;; esac done shift $(($OPTIND - 1)) @@ -50,5 +97,7 @@ case "$1" in ls|list) sv_list "$2" ;; enable) sv_enable "$2" ;; disable) sv_disable "$2" ;; + deps) shift 1; sv_deps "$@" ;; + tree) shift 1; sv_tree "$SVDIR" ;; *) SVDIR="$SVDIR" sv "$@" ;; esac diff --git a/bin/venv b/bin/venv @@ -2,11 +2,15 @@ readonly PROGNAME=$(basename $0) +function venv_list { + ls -l "$VENV_PATH" +} + function venv_create { - if [[ ! -d $VENV_PATH/$1 ]]; then - mkdir -pv $VENV_PATH/$1 + if [[ ! -d "$VENV_PATH/$1" ]]; then + mkdir -pv "$VENV_PATH/$1" fi - ${VENV_CMD} $VENV_PATH/$1 + ${VENV_CMD} "$VENV_PATH/$1" } function venv_delete { @@ -65,6 +69,7 @@ if [ -r ${CONFIG_FILE} ]; then fi case "$1" in + l*) venv_list $2;; cr*) venv_create $2;; del*) venv_delete $2;; ac*) venv_activate $2;; diff --git a/notes.md b/notes.md @@ -1,6 +1,7 @@ # Terminal `CTRL+s` `CTRL+q` Pause/resume output +`CTRL+i` complete file ## dvtm diff --git a/profile b/profile @@ -1,4 +1,8 @@ # load system profile . /etc/profile # Keychain -[ -r /usr/bin/keychain ] && eval `keychain --eval --agents ssh id_rsa` +#[ -r /usr/bin/keychain ] && eval `keychain --eval --agents ssh id_rsa` + +# runsvdir ~/service +export DISPLAY=:0 +export XAUTHORITY=~/.Xauthority diff --git a/service/x b/service/x @@ -1 +1 @@ -../sv/x- \ No newline at end of file +/home/duncan/sv/x+ \ No newline at end of file diff --git a/sv/syncthing/run b/sv/syncthing/run @@ -1,4 +1,4 @@ #!/bin/mksh exec 2>&1 -exec syncthing -logflags 0 +exec syncthing -logflags 0 -no-restart diff --git a/vimrc b/vimrc @@ -19,6 +19,7 @@ Plug 'Lokaltog/vim-easymotion' Plug 'bling/vim-airline' Plug 'majutsushi/tagbar' endif +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' } Plug 'kien/ctrlp.vim' Plug 'bling/vim-bufferline' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } diff --git a/xinitrc b/xinitrc @@ -33,4 +33,4 @@ repos/go-dwmstatus/go-dwmstatus & while true; do dwm >/dev/null 2>&1 done -#exec dwm +# exec dwm diff --git a/z b/z @@ -1 +1 @@ -Subproject commit d5adc9a6239c2ee44309fd78bca68f301eb0d45a +Subproject commit 99a09a93e44d436cd3756bfa763ae50966a3a7bf