dot

packages and services management
Log | Files | Refs | README

commit 2b45394994a4cf6c5d655ab502cbbf7198a692eb
parent 97a108e5d489540129c61d6a3eb0cd2789505822
Author: josuah <mail@josuah.net>
Date:   Mon, 10 Oct 2016 14:39:44 -0400

Restructuring again and again...

Diffstat:
Rbuild/abduco.sh -> BUILD/abduco.sh | 0
Rbuild/ag.sh -> BUILD/ag.sh | 0
Rbuild/byacc.sh -> BUILD/byacc.sh | 0
Rbuild/dmenu.sh -> BUILD/dmenu.sh | 0
Rbuild/dvtm.sh -> BUILD/dvtm.sh | 0
Rbuild/dwm.sh -> BUILD/dwm.sh | 0
Rbuild/fzf.sh -> BUILD/fzf.sh | 0
Rbuild/git.sh -> BUILD/git.sh | 0
Rbuild/isync.sh -> BUILD/isync.sh | 0
Rbuild/less.sh -> BUILD/less.sh | 0
Rbuild/libevent.sh -> BUILD/libevent.sh | 0
Rbuild/libncurses.sh -> BUILD/libncurses.sh | 0
Rbuild/libutf.sh -> BUILD/libutf.sh | 0
Rbuild/lua.sh -> BUILD/lua.sh | 0
Rbuild/m4.sh -> BUILD/m4.sh | 0
Rbuild/mmh.sh -> BUILD/mmh.sh | 0
Rbuild/msmtp.sh -> BUILD/msmtp.sh | 0
Rbuild/mujs.sh -> BUILD/mujs.sh | 0
Rbuild/pcre.sh -> BUILD/pcre.sh | 0
Rbuild/reflex.sh -> BUILD/reflex.sh | 0
Rbuild/s-nail.sh -> BUILD/s-nail.sh | 0
Rbuild/st.sh -> BUILD/st.sh | 0
Rbuild/tmux.sh -> BUILD/tmux.sh | 0
Rbuild/vim.sh -> BUILD/vim.sh | 0
Rbuild/yasm.sh -> BUILD/yasm.sh | 0
Rbuild/zsh.sh -> BUILD/zsh.sh | 0
ACONFIG/build.sh | 166+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ACONFIG/cron.sh | 6++++++
ACONFIG/git.sh | 10++++++++++
ACONFIG/link.sh | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ACONFIG/mail.sh | 10++++++++++
ACONFIG/sync.sh | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rinstall/vim.sh -> CONFIG/vim.sh | 0
Dbin/lsync | 115-------------------------------------------------------------------------------
Dbin/version | 77-----------------------------------------------------------------------------
Ddmenu/build/config.h | 23-----------------------
Ddmenu/build/config.mk | 31-------------------------------
Dinstall/build.sh | 156-------------------------------------------------------------------------------
Dinstall/cron.sh | 10----------
Dinstall/git.sh | 14--------------
Dinstall/link.sh | 65-----------------------------------------------------------------
Dinstall/mail.sh | 14--------------
Dinstall/sync.sh | 16----------------
Dmmh/mmh/context | 1-
Dmmh/mmh/profile | 1-
Rbin/adagio -> scripts/bin/adagio | 0
Ragenda/bin/agenda -> scripts/bin/agenda | 0
Rbkm/bin/bkm -> scripts/bin/bkm | 0
Rbin/blawk -> scripts/bin/blawk | 0
Rbin/buffers -> scripts/bin/buffers | 0
Rbin/complete -> scripts/bin/complete | 0
Rbin/dna -> scripts/bin/dna | 0
Rbin/drawk -> scripts/bin/drawk | 0
Rbin/fig -> scripts/bin/fig | 0
Rbin/irc -> scripts/bin/irc | 0
Rbin/lsync2 -> scripts/bin/lsync2 | 0
Rbin/music -> scripts/bin/music | 0
Rbin/peax -> scripts/bin/peax | 0
Rbin/piano -> scripts/bin/piano | 0
Rbin/piped -> scripts/bin/piped | 0
Rbin/swiper -> scripts/bin/swiper | 0
Rtodo/bin/todo -> scripts/bin/todo | 0
Rbin/updd -> scripts/bin/updd | 0
Rbin/www -> scripts/bin/www | 0
Ragenda/cache/agenda -> scripts/cache/agenda | 0
Rbkm/cache/bkm -> scripts/cache/bkm | 0
Rtodo/cache/todo -> scripts/cache/todo | 0
67 files changed, 367 insertions(+), 523 deletions(-)

diff --git a/build/abduco.sh b/BUILD/abduco.sh diff --git a/build/ag.sh b/BUILD/ag.sh diff --git a/build/byacc.sh b/BUILD/byacc.sh diff --git a/build/dmenu.sh b/BUILD/dmenu.sh diff --git a/build/dvtm.sh b/BUILD/dvtm.sh diff --git a/build/dwm.sh b/BUILD/dwm.sh diff --git a/build/fzf.sh b/BUILD/fzf.sh diff --git a/build/git.sh b/BUILD/git.sh diff --git a/build/isync.sh b/BUILD/isync.sh diff --git a/build/less.sh b/BUILD/less.sh diff --git a/build/libevent.sh b/BUILD/libevent.sh diff --git a/build/libncurses.sh b/BUILD/libncurses.sh diff --git a/build/libutf.sh b/BUILD/libutf.sh diff --git a/build/lua.sh b/BUILD/lua.sh diff --git a/build/m4.sh b/BUILD/m4.sh diff --git a/build/mmh.sh b/BUILD/mmh.sh diff --git a/build/msmtp.sh b/BUILD/msmtp.sh diff --git a/build/mujs.sh b/BUILD/mujs.sh diff --git a/build/pcre.sh b/BUILD/pcre.sh diff --git a/build/reflex.sh b/BUILD/reflex.sh diff --git a/build/s-nail.sh b/BUILD/s-nail.sh diff --git a/build/st.sh b/BUILD/st.sh diff --git a/build/tmux.sh b/BUILD/tmux.sh diff --git a/build/vim.sh b/BUILD/vim.sh diff --git a/build/yasm.sh b/BUILD/yasm.sh diff --git a/build/zsh.sh b/BUILD/zsh.sh diff --git a/CONFIG/build.sh b/CONFIG/build.sh @@ -0,0 +1,166 @@ +# Install sources from build receipes + +PROGRAMS="${PROGRAMS:-$HOME/Programs}" +PREFIX="${LOCAL:-$HOME/.local}" +CONFIG="${CONFIG:-$HOME/Config}" + + +# FUNCTIONS +#------------------------------------------------------------------------------- + +help() +{ + printf '%s\n' " +USAGE + [d|download] [i|install] [r|remove] PACKAGES + +PACKAGES" + find "$CONFIG/BUILD" -type f | while read file + do + name="${file#$CONFIG/BUILD/}" + name="${name%.sh}" + + printf '\t%-12s ' "$name" + sed 's/^# //; q' "$file" + done | sort | more + exit 0 +} + +error() +{ + printf '%s: \033[1;31m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 + exit 1 +} + +info() +{ + printf '%s: \033[1m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 +} + +compile() +{ + local name="$1" tar="$2" + local PREFIX="$PROGRAMS/$name" + local dirs='bin doc etc include lib libexec man share' + + info "Installing $name" + + cd "$PREFIX" && mkdir -p $dirs + cd src && build "$name" + cd "$PREFIX" && rmdir -p --ignore-fail-on-non-empty * +} + +download() +{ + local name="$1" tar="$2" + local tmp="$(mktemp -u)" + + if [ -d "$PROGRAMS/$name/src" ] + then + error "'$name/src' already in $PROGRAMS" + else + info "Downloading $tar" + + case "$tar" in + *.tar ) opt='' ;; + *.tbz2 | *.tar.bz2 ) opt='j' ;; + *.tgz | *.tar.gz ) opt='z' ;; + *.txz | *.tar.xz ) opt='J' ;; + *) error 'not a known tar extension' ;; + esac + + mkdir -p "$tmp" "$PROGRAMS/$name" + wget -O - "$tar" | tar -xv"$opt" -f - -C "$tmp" &> /dev/null + + mv "$tmp/"* "$PROGRAMS/$name/src" + rm -r "$tmp" + fi +} + +remove() +{ + local name="$1" + + info "Removing $name" + rm -rf "$PROGRAMS/$name" +} + +index() +{ + local name="$1" + + info "Updating index in $PREFIX" + + find "$PROGRAMS/$name" -mindepth 2 -type f ! -path "*/src/*" \ + | while read path + do + mkdir -p "$(dirname "$PREFIX/${path#$PROGRAMS/*/}")" + ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" + done +} + + +# ALGORYTHM +#------------------------------------------------------------------------------- + +mkdir -p "$PROGRAMS" + +opt="$1" +while shift && [ $# -gt 0 ] +do + [ ! -f "$CONFIG/BUILD/$1.sh" ] && error "$1 has no build script" + + tar='' + + # + # Default build function + # + build() + { + local build="$CONFIG/$1/build" + + for patch in $(find "$CONFIG/$1" -name '*.diff') + do + patch -Np1 < "$patch" + done + + [ -f "$build/config.mk" ] && cp -f "$build/config.mk" . + [ -f "$build/config.h" ] && cp -f "$build/config.h" . + [ -f ./autogen.sh ] && ./autogen.sh + [ -f ./configure ] && ./configure --prefix="$PREFIX" + + make + make prefix="$PREFIX" PREFIX="$PREFIX" install clean + return 0 + } + + # Build script specific to the program, with build() and tar='...' + . "$CONFIG/build/$1.sh" + + case "$opt" in + d | download ) + download "$1" "$tar" + index "$1" + ;; + i | compile ) + [ ! -d "$PROGRAMS/$name/src" ] && download "$1" "$tar" + compile "$1" + index "$1" + ;; + r | remove ) + remove "$1" + ;; + u | update ) + remove "$1" + download "$1" + compile "$1" + index "$1" + ;; + * | '' ) + help + ;; + esac +done + +# Remove broken links from the index +find -L "$PREFIX" -type l -exec rm {} \; diff --git a/CONFIG/cron.sh b/CONFIG/cron.sh @@ -0,0 +1,6 @@ +# Start and edit the cron tab + +c=~/.config/cron/tab + +crontab "$c" +crontab -l diff --git a/CONFIG/git.sh b/CONFIG/git.sh @@ -0,0 +1,10 @@ +# Clone projects git repository to ~/Projects + +git="$HOME/Projects" + +mkdir -p "$git" +cd "$git" + +sed '/^[ \t-]*$/ d; 1,/^PROJECTS$/ d' "$pwd/README" | while read line +do git clone --recursive "${line##* }" "${line%% *}" +done diff --git a/CONFIG/link.sh b/CONFIG/link.sh @@ -0,0 +1,66 @@ +# Link dotfiles and other resources to $HOME. + +CONFIG="${CONFIG:-$HOME/Config}" +LOCAL="${LOCAL:-$LOCAL}" + +# +# Link config files that follow XDG +# +for xdg in 'config' 'cache' +do + find "$CONFIG" -mindepth 2 -maxdepth 2 -type d -name "$xdg" \ + | while read name + do + name="${name#$CONFIG/}" + name="${name%/$xdg}" + + mkdir -p "$HOME/.$xdg" + + find "$CONFIG/$name/$xdg/" -mindepth 1 -type f \ + | while read path + do + file="${path#$CONFIG/$name/$xdg/}" + destination="$HOME/.$xdg/$name/$file" + + mkdir -p "$(dirname "$destination")" + ln -sf "$path" "$destination" + done + done +done + +# +# Link all other dotfiles +# +find "$CONFIG" -mindepth 2 -type f \ + ! -path '*/config/*' \ + ! -path '*/cache/*' \ + ! -path '*/build/*' \ + ! -path '*/bin/*' \ + ! -path '*/.*' \ +| while read path +do + file="${path#$CONFIG/*/}" + destination="$HOME/.$file" + + mkdir -p "$(dirname "$destination")" + ln -sf "$path" "$destination" +done + +# +# Link embedded executables +# +mkdir -p "$LOCAL/bin" + +find "$CONFIG" -type f -path '*/bin/*' \ +| while read path +do + file="${path##*/}" + destination="$LOCAL/bin/$file" + + ln -sf "$path" "$destination" +done + +# +# Delete dead links +# +find -L "$PREFIX" -type l -exec rm {} \; diff --git a/CONFIG/mail.sh b/CONFIG/mail.sh @@ -0,0 +1,10 @@ +# Prompt and stores the mail password + +mail='mail@josuah.net' +host='mail.gandi.net' + +mkdir -p "$HOME/Mail" "$HOME/.cache/mail" +read -p 'password: ' p +printf 'machine %s\nlogin %s\npassword "%s"' "$host" "$mail" "$p" > ~/.netrc +chmod 700 "$HOME/.netrc" +printf '\033[A\r\033[K' diff --git a/CONFIG/sync.sh b/CONFIG/sync.sh @@ -0,0 +1,109 @@ +# 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/install/vim.sh b/CONFIG/vim.sh diff --git a/bin/lsync b/bin/lsync @@ -1,115 +0,0 @@ -# , ,--. -# | `. , , ---. ,--. -# | `. | | | | | -# '--- `--' `--| ' ' `--' 2016-10-08 -#---------- `--' --------------------------------------------------------------- -# Sync two local directories. - -help=' -NAME - LSync - Mirror two local dirs keeping the latest version - -SYNTAX - lsync [-v] [-e PATTERN] DIR1 ['RULE'] DIR2 - -OPTIONS - -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. - -USAGE - 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/bin/version b/bin/version @@ -1,77 +0,0 @@ -# * -# . , ,--. .,-- ,--- , ,--. ---. -# \ / |--' | `--. | | | | | -# ' `--' ' ---' ' `--' ' ' 2016-10-08 -#------------------------------------------------------------------------------- -# A very very simple version control system and tool. -# -# / The top directory of the project. -# | -# |_ .version Version information. -# | | -# | |_ 2016-01-30-18-20-18 Result of mktemp [1]. -# | |_ 2016-01-30-18-23-39 -# | |_ 2016-01-31-05-25-01 -# | |_ ... -# | | -# | |_ .version Result of find [2]. Use the -# | | same name as the top level to -# | | prevent name clash. -# | | -# | |_ file1.txt Files that changed since previous state. -# | -# |_ README Content of the project at current state. -# |_ src -# | |_ Makefile -# | |_ main.c -# |_ file1.txt -# |_ file2.txt -# |_ ... -# -# commit, c -# Get the previous version of the project, compare all files (cmp) -# and if one differ, copy it to its 'history' dir with current -# date and a hash. -# -# status, s -# Get the files that differ - - -# FUNCTIONS -#------------------------------------------------------------------------------- - -changes() -{ - local from="$1" # History node from which to search difference -} - -commit() -{ - local date="$(date +'%0Y-%0m-%0d-%0H-%0M-%0S-%N')" - mkdir -p ".version/$date" - find . -mindepth 1 ! -path '*/.version/*' ! -name '.version' \ - > $dir/.version/date/.version -} - - -# ALGORYTHM -#------------------------------------------------------------------------------- - -# Check whether current or parent directory has a '.version' directory. - -DIR="$(pwd)" -while : -do - [ -z "$DIR" ] || [ -d "$DIR/.version" ] && break || DIR="${DIR%/*}" - printf '%s\n' "$DIR" -done - -if [ -z "$dir" ] -then - printf 'Not in a version directory, no .version directory found.\n' - exit 0 -fi - -case "$1" in -commit | c) commit ;; -esac diff --git a/dmenu/build/config.h b/dmenu/build/config.h @@ -1,23 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -/* Default settings; can be overriden by command line. */ - -static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ -/* -fn option overrides fonts[0]; default X11 font or font set */ -static const char *fonts[] = { - "mono:pixelsize=13:antialias=false", -}; -static const char *prompt = ">"; /* -p option; prompt to the left of input field */ -static const char *normbgcolor = "#000000"; /* -nb option; normal background */ -static const char *normfgcolor = "#ffffff"; /* -nf option; normal foreground */ -static const char *selbgcolor = "#000000"; /* -sb option; selected background */ -static const char *selfgcolor = "#ce578a"; /* -sf option; selected foreground */ -static const char *outbgcolor = "#00ffff"; -static const char *outfgcolor = "#000000"; -/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ -static unsigned int lines = 0; - -/* - * Characters not considered part of a word while deleting words - * for example: " /?\"&[]" - */ -static const char worddelimiters[] = " /?\"&[]"; diff --git a/dmenu/build/config.mk b/dmenu/build/config.mk @@ -1,31 +0,0 @@ -# dmenu version -VERSION = 4.6 - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} - -# flags -CPPFLAGS = -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} - -# compiler and linker -CC = cc diff --git a/install/build.sh b/install/build.sh @@ -1,156 +0,0 @@ -# ---. * | | -# |__/ , , , | .--| -# | \ | | | | | | -# ---' `--` ' ' `--` 2016-10-08 -#------------------------------------------------------------------------------- -# Install sources using crux-like package declaration. - -PROGRAMS="${PROGRAMS:-$HOME/Programs}" -PREFIX="${LOCAL:-$HOME/.local}" -CONFIG="${CONFIG:-$HOME/Config}" - - -# FUNCTIONS -#------------------------------------------------------------------------------- - -help() -{ - printf '%s\n' " -USAGE - [d|download] [i|install] [r|remove] PACKAGES... - -PACKAGES" - find "$CONFIG/build" -type f | while read file - do - name="${file#$CONFIG/build/}" - name="${name%.sh}" - - printf '\t%-12s ' "$name" - sed 's/^# //; q' "$file" - done | sort | more -} - -error() -{ - printf '%s: \033[1;31m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 -} - -info() -{ - printf '%s: \033[1m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 -} - -compile() -{ - local name="$1" tar="$2" - - [ ! -d "$PROGRAMS/$name/src" ] && download "$name" "$tar" - - info "Installing $name" - - local PREFIX="$PROGRAMS/$name" - local dirs='bin doc etc include lib libexec man share' - cd "$PREFIX" && mkdir -p $dirs - cd src && build "$name" - cd "$PREFIX" && rmdir -p --ignore-fail-on-non-empty * -} - -download() -{ - local name="$1" tar="$2" - - if [ -d "$PROGRAMS/$name/src" ] - then error "'$name/src' already in $PROGRAMS" - else info "Downloading $tar" - - case "$tar" in - *.tar ) opt='' ;; - *.tbz2 | *.tar.bz2 ) opt='j' ;; - *.tgz | *.tar.gz ) opt='z' ;; - *.txz | *.tar.xz ) opt='J' ;; - *) error 'not a known tar extension' ;; - esac - - tmp="$(mktemp -d)" - - wget -O - "$tar" | tar -xv"$opt" -f - -C "$tmp" &> /dev/null - - mkdir -p "$PROGRAMS/$name" - mv "$tmp/"* "$PROGRAMS/$name/src" - rm -r "$tmp" - fi -} - -remove() -{ - local name="$1" - - info "Removing $name" - rm -rf "$PROGRAMS/$name" -} - -index() -{ - local name="$1" - - info "Updating index in $PREFIX" - - find "$PROGRAMS/$name" -mindepth 2 -type f ! -path "*/src/*" \ - | while read path - do - mkdir -p "$(dirname "$PREFIX/${path#$PROGRAMS/*/}")" - ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" - done -} - - -# ALGORYTHM -#------------------------------------------------------------------------------- - -[ $# -le 1 ] && help && exit 0 - -mkdir -p "$PROGRAMS" - -opt="$1" -while shift && [ $# -gt 0 ] -do - if [ ! -f "$CONFIG/build/$1.sh" ] - then error "$1 has no build.sh script" - exit 1 - fi - - tar='' - - # - # Default build function - # - build() - { - local build="$CONFIG/$1/build" - - for patch in $(find "$CONFIG/$1" -name '*.diff') - do patch -Np1 < "$patch" - done - - [ -f "$build/config.mk" ] && cp -f "$build/config.mk" . - [ -f "$build/config.h" ] && cp -f "$build/config.h" . - [ -f ./autogen.sh ] && ./autogen.sh - [ -f ./configure ] && ./configure --prefix="$PREFIX" - - make - make prefix="$PREFIX" PREFIX="$PREFIX" install clean - return 0 - } - - . "$CONFIG/build/$1.sh" # Specific build script - - case "$opt" in - d | download ) download "$1" "$tar"; index "$1" ;; - i | compile ) compile "$1" "$tar"; index "$1" ;; - r | remove ) remove "$1" ;; - * ) error "unknown option: $opt"; help ;; - esac -done - -# Remove broken links from the index -find -L "$PREFIX" -type l -exec rm {} \; diff --git a/install/cron.sh b/install/cron.sh @@ -1,10 +0,0 @@ -# ,--. | | -# | .,-- ,--. ---. |-- ,--. |--. -# | | | | | | | ,--| | | -# `--' ' `--' ' ' ' `--` '--' 2016-10-10 -#------------------------------------------------------------------------------- - -c=~/.config/cron/tab - -crontab "$c" -crontab -l diff --git a/install/git.sh b/install/git.sh @@ -1,14 +0,0 @@ -# ,--. * | -# | , |-- -# | -. | | -# `--' ' ' 2016-10-10 -#------------------------------------------------------------------------------- - -git="$HOME/Projects" - -mkdir -p "$git" -cd "$git" - -sed '/^[ \t-]*$/ d; 1,/^PROJECTS$/ d' "$pwd/README" | while read line -do git clone --recursive "${line##* }" "${line%% *}" -done diff --git a/install/link.sh b/install/link.sh @@ -1,65 +0,0 @@ -# , * | -# | , ---. | , -# | | | | |-< -# '--- ' ' ' ' ` 2016-10-08 -#------------------------------------------------------------------------------- - -CONFIG="${CONFIG:-$HOME/Config}" -LOCAL="${LOCAL:-$LOCAL}" - -# -# Link config files that follow XDG -# -for xdg in 'config' 'cache' -do - find "$CONFIG" -mindepth 2 -maxdepth 2 -type d -name "$xdg" \ - | while read name - do - name="${name#$CONFIG/}" - name="${name%/$xdg}" - - mkdir -p "$HOME/.$xdg" - - find "$CONFIG/$name/$xdg/" -mindepth 1 -type f \ - | while read path - do - file="${path#$CONFIG/$name/$xdg/}" - destination="$HOME/.$xdg/$name/$file" - - mkdir -p "$(dirname "$destination")" - ln -sf "$path" "$destination" - done - done -done - -# -# Link all other dotfiles -# -find "$CONFIG" -mindepth 2 -type f \ - ! -path '*/config/*' \ - ! -path '*/cache/*' \ - ! -path '*/build/*' \ - ! -path '*/bin/*' \ - ! -path '*/.*' \ -| while read path -do - file="${path#$CONFIG/*/}" - destination="$HOME/.$file" - - mkdir -p "$(dirname "$destination")" - ln -sf "$path" "$destination" -done - -# -# Link embedded executables -# -mkdir -p "$LOCAL/bin" - -find "$CONFIG" -type f -path '*/bin/*' \ -| while read path -do - file="${path##*/}" - destination="$LOCAL/bin/$file" - - ln -sf "$path" "$destination" -done diff --git a/install/mail.sh b/install/mail.sh @@ -1,14 +0,0 @@ -# . . * | -# |\ /| ,--. , | ,--- -# | | | ,--| | | `--. -# ' ' `--` ' ' ---' 2016-10-10 -#------------------------------------------------------------------------------- - -mail='mail@josuah.net' -host='mail.gandi.net' - -mkdir -p "$HOME/Mail" "$HOME/.cache/mail" -read -p 'password: ' p -printf 'machine %s\nlogin %s\npassword "%s"' "$host" "$mail" "$p" > ~/.netrc -chmod 700 "$HOME/.netrc" -printf '\033[A\r\033[K' diff --git a/install/sync.sh b/install/sync.sh @@ -1,16 +0,0 @@ -# ,--. * | * -# `. , , ---. ,--. .,-- ,--. ---. , ---, ,--. |-- , ,--. ---. -# `. | | | | | | | | | | | ,' ,--| | | | | | | -# `--' `--| ' ' `--' ' `--' ' ' ' '--- `--` ' ' `--' ' ' 2016-10-10 -#----- `--' -------------------------------------------------------------------- - -Sync="$HOME/Sync" - -find "$Sync" -maxdepth 1 -type d -path "$Sync/*" -exec ln -sf {} ~ \; -find "$pwd" -path "$pwd/[^.]*/.*" | while read path -do - if [ -d "$path" ] - then mkdir -p "$HOME/${path#$pwd/*/}" - else ln -sf "$path" "$HOME/${path#$pwd/*/}" - fi -done diff --git a/mmh/mmh/context b/mmh/mmh/context @@ -1 +0,0 @@ -Current-Folder: inbox diff --git a/mmh/mmh/profile b/mmh/mmh/profile @@ -1 +0,0 @@ -Path: /home/sshbio/MAIL diff --git a/bin/adagio b/scripts/bin/adagio diff --git a/agenda/bin/agenda b/scripts/bin/agenda diff --git a/bkm/bin/bkm b/scripts/bin/bkm diff --git a/bin/blawk b/scripts/bin/blawk diff --git a/bin/buffers b/scripts/bin/buffers diff --git a/bin/complete b/scripts/bin/complete diff --git a/bin/dna b/scripts/bin/dna diff --git a/bin/drawk b/scripts/bin/drawk diff --git a/bin/fig b/scripts/bin/fig diff --git a/bin/irc b/scripts/bin/irc diff --git a/bin/lsync2 b/scripts/bin/lsync2 diff --git a/bin/music b/scripts/bin/music diff --git a/bin/peax b/scripts/bin/peax diff --git a/bin/piano b/scripts/bin/piano diff --git a/bin/piped b/scripts/bin/piped diff --git a/bin/swiper b/scripts/bin/swiper diff --git a/todo/bin/todo b/scripts/bin/todo diff --git a/bin/updd b/scripts/bin/updd diff --git a/bin/www b/scripts/bin/www diff --git a/agenda/cache/agenda b/scripts/cache/agenda diff --git a/bkm/cache/bkm b/scripts/cache/bkm diff --git a/todo/cache/todo b/scripts/cache/todo