commit e1c76fa5023363bc5d7e7ac34825a78dd8950532
parent c6a43fe7a72f73ae735d4448da81de7faa3291dc
Author: Josuah Demangeon <mail@josuah.net>
Date: Sun, 14 May 2017 21:47:52 +0200
Address. Layer 10
Diffstat:
18 files changed, 217 insertions(+), 71 deletions(-)
diff --git a/.exrc b/.exrc
@@ -0,0 +1 @@
+map g 1G
diff --git a/.profile b/.profile
@@ -81,7 +81,7 @@ PS1='
$(
printf "\033[m"
date +"[%H:%M]"
-) $PWD/$(git-status)${SSH_TTY:+ $(hostname)}${ABDUCO:+ $ABDUCO} ${?#0}
+) $USER@$(hostname) $PWD/$(git-status)${ABDUCO:+ $ABDUCO} ${?#0}
$(jobs | wc -l | sed s/0//)$([ "$USER" = root ] && printf \# || printf \$) '
PS2=' > '
PS3=' > '
@@ -106,11 +106,10 @@ alias la='ls -lpA'
alias cl='printf "\033[H\033[2J"'
# iomenu
-alias r='io-run'
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 | iomenu -p cd)"'
+alias c='cd "$(find "$HOME" -type d | sort | iomenu -p cd)"'
# utilities
alias inv='printf "\033[?5%s" h'
diff --git a/.xinitrc b/.xinitrc
@@ -1,6 +1,7 @@
#!/bin/sh
setxkbmap us -option compose:ralt
+xsetroot -bitmap etc/tile.xbm -bg '#222222' -fg '#000000'
xset +fp "$CONFIG/fonts"
while xsetroot -name "$(status)"
diff --git a/bin/build b/bin/build
@@ -61,7 +61,7 @@ download()
remove()
{
rm -rf "${OPT:?}/$1" "${SRC:?}/$1"
- find -L "$ROOT" -type l -exec rm {} \;
+ find -L "$ROOT" -type l -exec rm {} +
}
diff --git a/bin/daemon b/bin/daemon
diff --git a/bin/fun-dna b/bin/fun-dna
@@ -85,7 +85,7 @@ random()
done | while read -r n
do
nucleotide "$n"
- sleep 0.8
+ sleep 1
done
}
diff --git a/bin/fun-psyche b/bin/fun-psyche
@@ -1,5 +1,10 @@
+pause()
+{
+ dd if=/dev/zero of=/dev/null bs=1 count=32768 2> /dev/null
+}
+
set -- `
- printf '%s\n' "$*" | fold -w 1 | sed 's/[\t ]/_/; /^$/ s/^/_/'
+ printf '%s\n' "$*" | fold -w 1 | sed 's/[ ]/_/; /^$/ s/^/_/'
seq 10 | sed 's/.*/_/'
`
@@ -27,7 +32,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -47,7 +52,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -67,7 +72,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -87,7 +92,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ '$b' _'$e' ___ ___,--._________
@@ -107,7 +112,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
'$b'_____'$e' _ '$b'___'$e' ___,--._________
@@ -127,7 +132,7 @@ printf '\033[H%s' '
(_) '$b'`-'$e'|____|'$b'/'$e'_______'$b'\___'$e'_____________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -147,7 +152,7 @@ printf '\033[H%s' '
'$b'(_)'$e' `-|____|/_______'$b'\________________/'$e'
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -167,7 +172,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\_____'$b'___________/'$e'
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -187,7 +192,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___'$b',--._________'$e'
@@ -207,7 +212,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -227,7 +232,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -247,7 +252,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -267,7 +272,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -287,7 +292,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -307,7 +312,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -327,7 +332,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -347,7 +352,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -367,7 +372,7 @@ printf '\033[H%s' '
(_) `-|____|/_______\________________/
'
-sleep 0.05
+pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
@@ -392,7 +397,8 @@ printf '\033[H%s' '
while [ "$#" -gt 10 ]
do
shift
- sleep 0.1
+
+ pause
printf '\033[H%s' '
_____ _ ___ ___,--._________
diff --git a/bin/fun-type b/bin/fun-type
@@ -4,7 +4,7 @@ while IFS='' read -r line
do
while [ "$line" ]
do
- printf %s "$line" | cut -zb 1
+ printf %s "$line" | cut -b 1
line="${line#?}"
done
printf '\n'
diff --git a/bin/io b/bin/io
@@ -1,56 +1,84 @@
-# filter lines and sort them into categories to be open with different tools
-
+# cache and filter find output and execute one path as argument of a script
[ "$ABDUCO" ] && exit 1
CACHE="${XDG_CACHE_DIR:-$HOME/.cache}"
mkdir -p "$CACHE/io"
+touch "$HOME/.abduco/names"
-# --- cache --------------------------------------------------------------------
+# --- selection ----------------------------------------------------------------
-IFS=:
-nohup find "$HOME" $MANPATH -type d -o -type f \
- -path "$HOME/.*" -prune -o \
- -path "*/.git/*" -prune -o \
- -path "*/.hg/*" -prune -o \
- -path "*/v" -prune -o \
- -path "${MAIL%/*}/*/*" -prune -o \
- -type d -exec printf '%s/\n' {} + -o \
- -print 2> /dev/null | sort -o "$CACHE/find" &
-unset IFS
+selection=`{
+ printf '# %s\n' abduco
+ io-abduco
+ awk -v IRC="$IRC" -v MAIL="${MAIL%/*}" -v MUSIC="$MUSIC" '
-# --- selection ----------------------------------------------------------------
+$0 ~ IRC "/.*/$" {
+ ircv[ircc++] = $0;
+}
-selection="`{
- printf '# %s\n' abduco
- abduco | sed '1d; s/.* //; y|!|/|'
+$0 ~ MAIL {
+ mailv[mailc++] = $0;
+}
+
+$0 ~ ".git/$" || ($0 ~ "/src/[^/]*/$" && $0 !~ "/src/.*/src/") {
+ sub(".git/$", "");
+ searchv[searchc++] = $0;
+}
- printf '# %s\n' irc
- grep "$IRC/.*/$" "$CACHE/find"
+$0 ~ MUSIC {
+ musicv[musicc++] = $0;
+}
- printf '# %s\n' mail
- grep "${MAIL%/*}" "$CACHE/find"
+$0 ~ "/man/.*.[1-9](.gz)?$" {
+ manv[manc++] = $0;
+}
- printf '# %s\n' search
- grep '\.git/$' "$CACHE/find" | sed 's|.git/||'
- grep '/src/[^/]*/$' "$CACHE/find" | grep -v '/src/.*/src/'
+$0 !~ "/$" {
+ filesv[filesc++] = $0;
+}
- printf '# %s\n' music
- grep "$MUSIC" "$CACHE/find"
+END {
+ print "# irc";
+ for (i = 0; i < ircc; i++) print(ircv[i] );
- printf '# %s\n' man
- grep '/man/.*\.[1-9].gz$' "$CACHE/find"
+ print "# mail";
+ for (i = 0; i < mailc; i++) print(mailv[i] );
- printf '# %s\n' files
- grep '[^/]$' "$CACHE/find"
+ print "# search";
+ for (i = 0; i < searchc; i++) print(searchv[i]);
-} | iomenu -p io -s -h | cut -c 3-`"
+ print "# music";
+ for (i = 0; i < musicc; i++) print(musicv[i] );
+
+ print "# man";
+ for (i = 0; i < manc; i++) print(manv[i] );
+
+ print "# files";
+ for (i = 0; i < filesc; i++) print(filesv[i] );
+}
+' "$CACHE/find"
+
+} | iomenu -p io -s -h | cut -c 3-`
command="io-${selection%% *}"
path="${selection#* }"
-name=`printf %s "$path" | tr '/' '!'`
+
+
+# --- cache --------------------------------------------------------------------
+
+IFS=:
+nohup find "$HOME" \
+ -path "$HOME/.*" -prune -o \
+ -path "*/.git/*" -prune -o \
+ -path "*/.hg/*" -prune -o \
+ -path "*/v" -prune -o \
+ -path "${MAIL%/*}/*/*" -prune -o \
+ -type d -exec printf '%s/\n' {} + -o \
+ -print 2> /dev/null | sort -o "$CACHE/find" &
+unset IFS
# --- attach -------------------------------------------------------------------
@@ -59,5 +87,5 @@ printf '\033[H\033[2J'
[ "$SSH_TTY" ] && e='^\' || e='^Z'
-command -v "$command" && [ "$name" ] &&
-ABDUCO="$name" exec abduco -e "$e" -A "$name" $command "$path"
+command -v "$command" && [ "$path" ] &&
+exec io-abduco $command "$path"
diff --git a/bin/io-abduco b/bin/io-abduco
@@ -1,5 +1,38 @@
-# just attach to an abduco session
+# attach to an abduco sessions and manage the names
-set -- "`printf %s "$1" | tr / !`"
-ABDUCO=$1 exec abduco -a "$1"
+DIR=${ABDUCO_SOCKET_DIR:-$HOME/.abduco}
+
+touch "$DIR/names"
+
+case $# in
+( 0 ) attach=0 ;;
+( 1 ) attach=1 command=less path=$1 ;;
+( 2 ) attach=1 command=$1 path=$2 ;;
+( * ) exit 1 ;;
+esac
+
+
+# --- update names -------------------------------------------------------------
+
+hash=`printf %s "$path" | md5sum | cut -d ' ' -f 1`
+
+{
+ [ "$attach" = 1 ] && printf '%s %s\n' "$hash" "$path"
+
+ {
+ abduco | sed '1d; s/.* /-e\n/'
+ printf '%s\n' "$DIR/names"
+
+ } | xargs grep -F
+
+} | sort -k 1,1 -u -o "$DIR/names"
+
+if [ "$attach" = 1 ]
+then
+ [ "$ABDUCO" ] && exit 1
+ [ "$SSH_TTY" ] && e='^\' || e='^Z'
+ ABDUCO=$1 exec abduco -e "$e" -A "$hash" "$command" "$path"
+else
+ sed 's/[^ ]* //' "$DIR/names"
+fi
diff --git a/bin/status b/bin/status
@@ -1,7 +1,7 @@
# plain text status line for wherever useful
-SEPARATOR=' '
+SEPARATOR=' | '
START=' '
STOP=' '
@@ -24,7 +24,7 @@ status_mail()
status_date()
{
- date +'%m/%d %H:%M'
+ date +'%m/%d %H:%M'
}
@@ -38,11 +38,8 @@ status_cpu()
status_battery()
{
- if [ -f /sys/class/power_supply/*/capacity ]
- then
- read -r battery < /sys/class/power_supply/*/capacity
- printf '%d%%' "$battery"
- fi
+ [ -f /sys/class/power_supply/*/capacity ] &&
+ printf '%d%%' "`cat /sys/class/power_supply/*/capacity`"
}
diff --git a/build/dwm/config.h b/build/dwm/config.h
@@ -12,6 +12,7 @@ static const char selbordercolor[] = "#ffffff";
static const char selbgcolor[] = "#ffffff";
static const char selfgcolor[] = "#000000";
static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int gappx = 10; /* gap pixel between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
diff --git a/build/dwm/dwm-uselessgap-6.1.diff b/build/dwm/dwm-uselessgap-6.1.diff
@@ -0,0 +1,54 @@
+--- dwm/dwm.c.orig 2015-11-22 13:26:16.664650238 -0700
++++ dwm/dwm.c 2015-11-22 13:25:57.407984351 -0700
+@@ -52,8 +52,8 @@
+ #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
+ #define LENGTH(X) (sizeof X / sizeof X[0])
+ #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
+-#define WIDTH(X) ((X)->w + 2 * (X)->bw)
+-#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
++#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx)
++#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx)
+ #define TAGMASK ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X) (drw_text(drw, 0, 0, 0, 0, (X), 0) + drw->fonts[0]->h)
+
+@@ -1293,12 +1293,36 @@ void
+ resizeclient(Client *c, int x, int y, int w, int h)
+ {
+ XWindowChanges wc;
++ unsigned int n;
++ unsigned int gapoffset;
++ unsigned int gapincr;
++ Client *nbc;
+
+- c->oldx = c->x; c->x = wc.x = x;
+- c->oldy = c->y; c->y = wc.y = y;
+- c->oldw = c->w; c->w = wc.width = w;
+- c->oldh = c->h; c->h = wc.height = h;
+ wc.border_width = c->bw;
++
++ /* Get number of clients for the selected monitor */
++ for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++);
++
++ /* Do nothing if layout is floating */
++ if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) {
++ gapincr = gapoffset = 0;
++ } else {
++ /* Remove border and gap if layout is monocle or only one client */
++ if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) {
++ gapoffset = 0;
++ gapincr = -2 * borderpx;
++ wc.border_width = 0;
++ } else {
++ gapoffset = gappx;
++ gapincr = 2 * gappx;
++ }
++ }
++
++ c->oldx = c->x; c->x = wc.x = x + gapoffset;
++ c->oldy = c->y; c->y = wc.y = y + gapoffset;
++ c->oldw = c->w; c->w = wc.width = w - gapincr;
++ c->oldh = c->h; c->h = wc.height = h - gapincr;
++
+ XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ configure(c);
+ XSync(dpy, False);
diff --git a/build/geomyidae/url b/build/geomyidae/url
@@ -0,0 +1 @@
+http://git.r-36.net/geomyidae/snapshot/geomyidae-HEAD.tar.gz
diff --git a/build/mandoc/build b/build/mandoc/build
@@ -4,7 +4,7 @@ BINDIR="$PREFIX/bin"
SBINDIR="$PREFIX/bin"
INCLUDEDIR="$PREFIX/include/mandoc"
LIBDIR="$PREFIX/lib/mandoc"
-MANDIR="$PREFIX/man"
+MANDIR="$PREFIX/share/man"
BUILD_DB=1
EOF
diff --git a/build/python/build b/build/python/build
@@ -0,0 +1,2 @@
+OPT= ./configure --prefix="$PREFIX"
+OPT= make install
diff --git a/build/python/url b/build/python/url
@@ -0,0 +1 @@
+http://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
diff --git a/tile.xbm b/tile.xbm
@@ -0,0 +1,22 @@
+#define tile_width 56
+#define tile_height 32
+static unsigned char tile_bits[] = {
+ 0x01, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x06, 0x40, 0x20, 0x10, 0x08,
+ 0x04, 0xc0, 0x18, 0x40, 0x20, 0x10, 0x08, 0x04, 0x30, 0x60, 0x40, 0x20,
+ 0x10, 0x08, 0x04, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0xe0,
+ 0x43, 0x18, 0x10, 0x30, 0x84, 0x0f, 0x98, 0x4c, 0x06, 0x10, 0xc0, 0x64,
+ 0x32, 0x86, 0xf0, 0x01, 0x10, 0x00, 0x1f, 0xc2, 0x81, 0x70, 0x00, 0x10,
+ 0x00, 0x0c, 0x02, 0x81, 0x08, 0x00, 0x6c, 0x00, 0x18, 0x02, 0x81, 0x04,
+ 0x00, 0x83, 0x01, 0x60, 0x02, 0x81, 0x03, 0xc0, 0x00, 0x06, 0x80, 0x03,
+ 0x81, 0x00, 0x20, 0x00, 0x08, 0x00, 0x02, 0x81, 0x03, 0x18, 0x00, 0x30,
+ 0x80, 0x03, 0x81, 0x0c, 0x06, 0x00, 0xc0, 0x60, 0x02, 0x81, 0xb0, 0x01,
+ 0x10, 0x00, 0x1b, 0x02, 0x81, 0x40, 0x00, 0x6c, 0x00, 0x04, 0x02, 0x81,
+ 0x40, 0x00, 0x82, 0x00, 0x04, 0x02, 0x81, 0x40, 0x80, 0x01, 0x03, 0x04,
+ 0x02, 0x81, 0x40, 0x40, 0x00, 0x04, 0x04, 0x02, 0x81, 0x40, 0x70, 0x00,
+ 0x1c, 0x04, 0x02, 0x01, 0x43, 0xac, 0x01, 0x6b, 0x84, 0x01, 0x01, 0x4c,
+ 0x22, 0x82, 0x88, 0x64, 0x00, 0x01, 0xf0, 0x21, 0x6c, 0x08, 0x1f, 0x00,
+ 0x01, 0x60, 0x20, 0x10, 0x08, 0x0c, 0x00, 0x06, 0x80, 0x20, 0x10, 0x08,
+ 0x02, 0xc0, 0x18, 0x00, 0x23, 0x10, 0x88, 0x01, 0x30, 0x60, 0x00, 0x2c,
+ 0x10, 0x68, 0x00, 0x0c, 0x80, 0x00, 0x38, 0x10, 0x38, 0x00, 0x02, 0x00,
+ 0x03, 0x26, 0x10, 0xc8, 0x80, 0x01, 0x00, 0x8c, 0x21, 0x10, 0x08, 0x63,
+ 0x00, 0x00, 0x70, 0x20, 0x10, 0x08, 0x1c, 0x00 };