dot

packages and services management
Log | Files | Refs | README

commit 8da8cc92df33dd53f8b149e40edd89adb7999443
parent ce173dffc8c3167a403e5fc3eeed26a898d2347c
Author: josuah <mail@josuah.net>
Date:   Sat,  8 Oct 2016 23:13:21 -0400

Removed shebangs for shell scripts: more reliable

Diffstat:
Magenda/bin/agenda | 3+--
Mbin/buffers | 5++---
Mbin/complete | 1-
Mbin/dna | 3+--
Mbin/fig | 1-
Mbin/irc | 1-
Mbin/lsync | 11+++++------
Mbin/music | 1-
Mbin/piano | 22+++++++++++++---------
Mbin/swiper | 3+--
Mbin/updd | 1-
Mbin/version | 1-
Mbin/www | 1-
Mbkm/bin/bkm | 3+--
Mbuild.sh | 47+++++++++++++++++++++++++----------------------
Mfeeds/bin/feeds | 1-
Mlink.sh | 2+-
Mshell/config/environment | 15++++++++-------
Mtodo/bin/todo | 3+--
Mtodo/cache/todo | 1+
20 files changed, 60 insertions(+), 66 deletions(-)

diff --git a/agenda/bin/agenda b/agenda/bin/agenda @@ -1,4 +1,3 @@ -#!/bin/sh # | # ,--. ,--, ,--. ---. .--| ,--. # ,--| | | |--' | | | | ,--| @@ -6,7 +5,7 @@ #------`--'--------------------------------------------------------------------- # Agenda from the command line -AGENDA="${AGENDA-$HOME/.cache/agenda}" +AGENDA="${AGENDA-$HOME/.cache/agenda/agenda}" COLUMNS="$(stty size | cut -d ' ' -f 2)" help="NAME diff --git a/bin/buffers b/bin/buffers @@ -1,11 +1,10 @@ -#/bin/sh # ---. ,-- ,-- # |__/ , , |- |- ,--. .,-- ,--- # | \ | | | | |--' | `--. # ---' `--` ' ' `--' ' ---' 2016-10-08 #------------------------------------------------------------------------------- # Run commands in detachable buffers -# + # External: stest (dmenu), fzf, abduco # Busybox: mkdir, tee, sort, clear, tr, sed @@ -97,7 +96,7 @@ a | attach ) ;; * ) - printf '%s\' "$help" + printf '%s\n' "$help" exit 0 esac diff --git a/bin/complete b/bin/complete @@ -1,4 +1,3 @@ -#!/bin/sh # | | # ,--. ,--. --.-. ---. | ,--. |-- ,--. # | | | | | | | | | |--' | |--' diff --git a/bin/dna b/bin/dna @@ -1,11 +1,10 @@ -#!/bin/sh # | # .--| ---. ,--. # | | | | ,--| # `--` ' ' `--` 2016-10-07 #------------------------------------------------------------------------------- # Prints $dna with full structure, sequentially -# + # USAGE: # dna [ATCG] # diff --git a/bin/fig b/bin/fig @@ -1,4 +1,3 @@ -#!/bin/sh # ,-- ' # | | ,--, # |- | | | diff --git a/bin/irc b/bin/irc @@ -1,4 +1,3 @@ -#!/bin/sh # * # , .,-- ,--. # | | | diff --git a/bin/lsync b/bin/lsync @@ -1,9 +1,8 @@ -#!/bin/sh -# | -# | ,--- , , ---. ,--. -# | `--. | | | | | -# ' ---' `--| ' ' `--' 2016-10-07 -#--------`--'------------------------------------------------------------------- +# , ,--. +# | `. , , ---. ,--. +# | `. | | | | | +# '--- `--' `--| ' ' `--' 2016-10-08 +#---------- `--' --------------------------------------------------------------- # Sync two local directories. help=' diff --git a/bin/music b/bin/music @@ -1,4 +1,3 @@ -#!/bin/sh # * # --.-. , , ,--- , ,--. # | | | | | `--. | | diff --git a/bin/piano b/bin/piano @@ -1,14 +1,15 @@ #!/usr/bin/awk -f -# * -# ---. , ,--. ---. ,--. -# | | | ,--| | | | | -# |--' ' `--` ' ' `--' 2016-10-07 -#-|----------------------------------------------------------------------------- +# ---. * +# |__| , ,--. ---. ,--. +# | | ,--| | | | | +# ' ' `--` ' ' `--' 2016-10-08 +#------------------------------------------------------------------------------- # Console beep piano! BEGIN { -#===[ KEYBOARD LAYOUT ]========================================================= +# KEYBOARD LAYOUT +#------------------------------------------------------------------------------- # QWERTY # ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ @@ -52,7 +53,8 @@ BEGIN { layout = dvorak; -#===[ NOTES FREQUENCIES ]======================================================= +# NOTES FREQUENCIES +#------------------------------------------------------------------------------- C0 = 16 " "; Cd0 = 17 " "; D0 = 18 " "; Dd0 = 19 " "; E0 = 21 " "; F0 = 22 " "; Fd0 = 23 " "; G0 = 25 " "; @@ -82,7 +84,8 @@ BEGIN { E8 = 5274 " "; F8 = 5588 " "; Fd8 = 5920 " "; G8 = 6272 " "; Gd8 = 6645 " "; A8 = 7040 " "; Ad8 = 7459 " "; B8 = 7902 " "; -#===[ NOTES SELECTION ]========================================================= +# NOTES SELECTION +#------------------------------------------------------------------------------- print "\ _________________________________________________________________________\n\ @@ -113,7 +116,8 @@ BEGIN { ROW1 = row1; ROW2 = C4 Cd4 D4 Dd4 E4 F4 Fd4 G4 Gd4 A4 Ad4 B4 C5 Cd5 D5 Dd5 E5 F5 Fd5 G5; -#===[ ALGORYTHM ]=============================================================== +# ALGORYTHM +#------------------------------------------------------------------------------- split(row1 row2 ROW1 ROW2, frequencies, " "); diff --git a/bin/swiper b/bin/swiper @@ -1,4 +1,3 @@ -#!/bin/sh # * # ,--- , , , , ---. ,--. .,-- # `--. | | | | | | |--' | @@ -6,7 +5,7 @@ #--------------|---------------------------------------------------------------- # A search with an overview. Oh, man! -FILTER=fzf-tmux +FILTER="${FILTER:-fzf-tmux}" i=0 [ ! -f $1 ] && printf 'USAGE:\tswiper [file]\n' diff --git a/bin/updd b/bin/updd @@ -1,4 +1,3 @@ -#!/bin/sh # | | # , , ---. .--| .--| # | | | | | | | | diff --git a/bin/version b/bin/version @@ -1,4 +1,3 @@ -#!/bin/sh # * # . , ,--. .,-- ,--- , ,--. ---. # \ / |--' | `--. | | | | | diff --git a/bin/www b/bin/www @@ -1,4 +1,3 @@ -#!/bin/sh # , , , , , , , , , # | | | | | | | | | # `-'-' `-'-' `-'-' 2016-10-07 diff --git a/bkm/bin/bkm b/bkm/bin/bkm @@ -1,4 +1,3 @@ -#!/bin/sh # | | # |--. | / --.-. # | | |-< | | | @@ -6,7 +5,7 @@ #------------------------------------------------------------------------------- # Tiny shell bookmark manager -BOOKMARKS="${BKM:-$HOME/.cache/bkm}" +BOOKMARKS="${BKM:-$XDG_CACHE_HOME/bkm/bkm}" if [ "$#" -eq 0 ] then diff --git a/build.sh b/build.sh @@ -1,4 +1,3 @@ -#!/bin/sh # ---. * | | # |__/ , , , | .--| # | \ | | | | | | @@ -18,10 +17,10 @@ help() { printf '%s\n' " NAME - src - Download and install source code from tar archives. + build - Download and install source code from tar archives. SYNTAX - src [COMMAND] PACKAGE PACKAGE ... + build [COMMAND] PACKAGE PACKAGE ... DESCRIPTION d download PACKAGE(s) into $PROGRAMS @@ -76,7 +75,7 @@ compile() local dirs='bin doc etc include lib libexec man share' cd "$PREFIX"; mkdir -p $dirs cd src; build "$name" - cd "$PREFIX"; rmdir -p $dirs + cd "$PREFIX"; rmdir -p --ignore-fail-on-non-empty * } download() @@ -89,15 +88,16 @@ download() else info "Downloading $tar" case "$tar" in - *.tar ) taroption='' ;; - *.tbz2 | *.tar.bz2 ) taroption='j' ;; - *.tgz | *.tar.gz ) taroption='z' ;; - *.txz | *.tar.xz ) taroption='J' ;; + *.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"$taroption" -f - -C "$tmp" + + wget -O - "$tar" | tar -xv"$opt" -f - -C "$tmp" &> /dev/null mkdir -p "$PROGRAMS/$name" mv "$tmp/"* "$PROGRAMS/$name/src" @@ -124,30 +124,35 @@ mkdir -p "$PROGRAMS" opt="$1" while shift && [ $# -gt 0 ] do - if [ ! -f "$CONFIG/$1/build.sh" ] + if [ ! -f "$CONFIG/build/$1.sh" ] then error "$1 has no build.sh script" exit 1 fi tar='' - build() # Default build function + # + # Default build function + # + build() { + local build="$CONFIG/$1/build" + for patch in $(find "$CONFIG/$1" -name '*.diff') - do patch -p1 < "$patch" + do patch -Np1 < "$patch" done - [ -f "$CONFIG/$1/config.mk" ] && cp -f "$CONFIG/$1/config.mk" . - [ -f "$CONFIG/$1/config.h" ] && cp -f "$CONFIG/$1/config.h" . - [ -f ./autogen.sh ] && ./autogen.sh - [ -f ./configure ] && ./configure --prefix="$PREFIX" + [ -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/$1/build.sh" # Specific build script + . "$CONFIG/build/$1.sh" # Specific build script case "$opt" in d ) download "$1" "$tar" ;; @@ -163,11 +168,9 @@ index() find "$PREFIX" -type l -delete; - find "$PROGRAMS" -mindepth 2 ! -path "*/src*" | while read path + find "$PROGRAMS" -mindepth 2 -type f ! -path "*/src/*" | while read path do - if [ -d "$path" ] - then mkdir -p "$PREFIX/${path#$PROGRAMS/*/}" - else ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" - fi + mkdir -p "$(dirname "$PREFIX/${path#$PROGRAMS/*/}")" + ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" done } diff --git a/feeds/bin/feeds b/feeds/bin/feeds @@ -1,4 +1,3 @@ -#!/bin/sh # ,-- | # |- ,--. ,--. .--| ,--- # | |--' |--' | | `--. diff --git a/link.sh b/link.sh @@ -8,7 +8,7 @@ CONFIG="${CONFIG:-$HOME/Config}" LOCAL="${LOCAL:-$LOCAL}" # -# Link config files that follow xdg +# Link config files that follow XDG # for xdg in 'config' 'cache' do diff --git a/shell/config/environment b/shell/config/environment @@ -1,13 +1,13 @@ # ---- * | # |__ ---. . , , .,-- ,--. ---. --.-. ,--. ---. |-- -# | | | \ / | | | | | | | | | |--" | | | -# ---- " " " " " `--" " " " " " `--" " " " +# | | | \ / | | | | | | | | | |--' | | | +# ---- ' ' ' ' ' `--' ' ' ' ' ' `--' ' ' ' # ------------------------------------------------------------------------------ # Environment variables. -# -# The right place would have been '.pam_environment', but setting the PATH -# here is not supported by Debian, that consider that it would be a -# security risk. + +# The right place would have been '.pam_environment', but Debian prevent +# users to set the path in it, considering that it would be a security +# risk. export EMAIL="mail@josuah.net" @@ -20,7 +20,7 @@ export ALTERNATE_EDITOR="vi" export VISUAL="${EDITOR}" export FCEDIT="${EDITOR}" export PAGER="more" # Within tmux, less useless -export FILTER="peax" # Like fzy, fzf, dmenu... +export FILTER="fzy" # Like fzy, fzf, dmenu... # DIRECTORIES @@ -28,6 +28,7 @@ export FILTER="peax" # Like fzy, fzf, dmenu... export MAIL="${HOME}/Mail/INBOX" export CONFIG="${HOME}/Config" +export PROGRAMS="${HOME}/Programs" export LOCAL="${HOME}/.local" export ENV="${HOME}/.profile" export XDG_CONFIG_HOME="${HOME}/.config" # If it is not set by default. diff --git a/todo/bin/todo b/todo/bin/todo @@ -1,4 +1,3 @@ -#!/bin/sh # | | # |-- ,--. .--| ,--. # | | | | | | | @@ -6,7 +5,7 @@ #------------------------------------------------------------------------------- # Small todo list implementation -todo="$HOME/.cache/todo" t='' cmd='' +todo="$HOME/.cache/todo/todo" t='' cmd='' if [ "$1" = e ]; then $EDITOR "$todo"; return 0; fi diff --git a/todo/cache/todo b/todo/cache/todo @@ -12,3 +12,4 @@ vis: 0, $ and ^ to work even on empty lines irc: ASCII mail pizza delivering irc server Call 0223233079 to tell if OK for UR1.fr d 13 +d 14