dot

packages and services management
Log | Files | Refs | README

commit fae7c3e7ae6e18e1ac6db7d10fc1de519d22b8c0
parent fa770b143d669eaaa82882061d7d21e591da74c4
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 21 Nov 2017 13:30:28 +0100

recovering from a crash

Caused by inconsistent filesystem

Diffstat:
Dbin/dot | 34----------------------------------
Abin/etc | 46++++++++++++++++++++++++++++++++++++++++++++++
Mbin/io | 4++--
Mbin/io-cache | 4++--
Mbin/package | 16++++------------
Mbin/status | 5++---
Abin/twt | 154+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dbin/twtsh | 151------------------------------------------------------------------------------
Rdot/gitconfig -> config/git/config | 0
Ddarkhttpd/start | 1-
Ddevel/git/bin/git-index | 109-------------------------------------------------------------------------------
Ddot/mbsyncrc | 19-------------------
Mdot/profile | 10+++++-----
Mio/gopher | 1+
Dlibbearssl/bin/irc | 56--------------------------------------------------------
Mpackage/dwm/config.h | 171+++++++++++++++++++++++++++++++++++++++----------------------------------------
Apackage/dwm/git | 1+
Dpackage/dwm/tar | 1-
Dservices/u9fs | 1-
Dtext/iomenu/bin/io-ps | 4----
Atwt | 0
Dtwtxt | 2--
22 files changed, 302 insertions(+), 488 deletions(-)

diff --git a/bin/dot b/bin/dot @@ -1,34 +0,0 @@ -#!/bin/sh - -ETC=$(cd "${0%/*}/.." && pwd) - -cd "$ETC/dot" || exit 1 -find * -type d -exec mkdir -p "$HOME/.{}" ';' -find * -type f -exec ln -fs "$ETC/dot/{}" "$HOME/.{}" ';' -find -L "$HOME" -type l -exec rm {} + - -mkdir -p "$HOME/lib/doc" -mkdir -p "$HOME/lib/image" -mkdir -p "$HOME/lib/music" -mkdir -p "$HOME/lib/video" -mkdir -p "$HOME/opt" -mkdir -p "$HOME/src" -mkdir -p "$HOME/tmp" -mkdir -p "$HOME/usr/etc" -mkdir -p "$HOME/usr/git" -mkdir -p "$HOME/var/cache" -mkdir -p "$HOME/var/irc" -mkdir -p "$HOME/var/log" -mkdir -p "$HOME/var/mail/INBOX/cur" -mkdir -p "$HOME/var/mail/INBOX/new" -mkdir -p "$HOME/var/mail/INBOX/tmp" -mkdir -p "$HOME/var/qemu" -mkdir -p "$HOME/var/run" -mkdir -p "$HOME/var/torrent" -mkdir -p "$HOME/var/tox" - -cat "$ETC/cron"/* > "$HOME/usr/etc/cron" -cat "$ETC/inetd"/* > "$HOME/usr/etc/inetd" -cat "$ETC/services"/* > "$HOME/usr/etc/inetd" - -fc-cache "$ETC/fonts" diff --git a/bin/etc b/bin/etc @@ -0,0 +1,46 @@ +#!/bin/sh + +ETC=$(cd "${0%/*}/.." && pwd) + +case $1 in +(dot) + cd "$ETC/dot" || exit 1 + find * -type d -exec mkdir -p "$HOME/.{}" ';' + find * -type f -exec ln -fs "$ETC/dot/{}" "$HOME/.{}" ';' + find -L "$HOME" -maxdepth 3 -type l -exec rm {} + + ;; +(config) + cd "$ETC/config" || exit 1 + find * -type d -exec mkdir -p "$HOME/.config/{}" ';' + find * -type f -exec ln -fs "$ETC/config/{}" "$HOME/.config/{}" ';' + find -L "$HOME" -maxdepth 3 -type l -exec rm {} + + ;; +(mkdir) + mkdir -p "$HOME/src" + mkdir -p "$HOME/git" + mkdir -p "$HOME/tmp" + mkdir -p "$HOME/var/irc" + mkdir -p "$HOME/var/log" + mkdir -p "$HOME/var/mail/INBOX/cur" + mkdir -p "$HOME/var/mail/INBOX/new" + mkdir -p "$HOME/var/mail/INBOX/tmp" + mkdir -p "$HOME/var/qemu" + mkdir -p "$HOME/var/run" + mkdir -p "$HOME/var/torrent" + mkdir -p "$HOME/var/tox" + ;; +(cron) + cat "$ETC/cron/$2" >> "$HOME/.config/crontab" + sort -uo "$HOME/.config/crontab" "$HOME/.config/crontab" + ;; +(inetd) + cat "$ETC/inetd/$2" >> "$HOME/.config/inetd" + sort -uo "$HOME/.config/inetd" "$HOME/.config/inetd" + ;; +(fonts) + fc-cache "$ETC/fonts" + ;; +(*) + printf 'usage: etc dot | config | mkdir | cron entry | inetd entry\n' + printf ' fonts\n' +esac diff --git a/bin/io b/bin/io @@ -3,7 +3,7 @@ export LC_COLLATE=C -touch "$ABDUCO_SOCKET_DIR/abduco/names" "$HOME/var/cache/io" +touch "$ABDUCO_SOCKET_DIR/abduco/names" "$HOME/.cache/io" grep -F "$ABDUCO_SOCKET_DIR/abduco/names" -e "$( abduco | sed 1d | cut -d ' ' -f 3- @@ -12,7 +12,7 @@ grep -F "$ABDUCO_SOCKET_DIR/abduco/names" -e "$( IFS=' ' [ $# = 0 ] && set -- $( cut -d ' ' -f 3- "$ABDUCO_SOCKET_DIR/abduco/names" | - cat - "$HOME/var/cache/io" "$HOME/etc/io"/* | iomenu -p io -# + cat - "$HOME/.cache/io" "$HOME/etc/io"/* | iomenu -p io -# ) unset IFS diff --git a/bin/io-cache b/bin/io-cache @@ -1,8 +1,8 @@ #!/bin/sh # build a list of files preceded by '#command to open them' -mkdir -p "$HOME/var/cache" -exec 1> "$HOME/var/cache/io" +mkdir -p "$HOME/.cache" +exec 1> "$HOME/.cache/io" echo '#rlwrap ii-client' find "$HOME/var/irc" -maxdepth 1 -mindepth 1 -type d | diff --git a/bin/package b/bin/package @@ -2,13 +2,12 @@ : ${2:?usage: ${0##*/} [tar git get build add del] package} -SYSROOT="$HOME/usr" +SYSROOT="$HOME/.local" PKG="$HOME/etc/package/$2" -SRC="$HOME/src/$2" -OPT="$HOME/opt/$2" +SRC="$HOME/.local/src/$2" +OPT="$HOME/.local/opt/$2" case "$1" in - (tar) [ -d "$SRC" ] && exit 0 @@ -23,14 +22,12 @@ case "$1" in mv "$(tar -tf "$SRC.tar" | sed -e 's|/.*||' -e 'q')" "$SRC" rm -f "$SRC.tar" ;; - (git) [ -d "$SRC" ] && exit 0 IFS='' read -r url < "$PKG/git" git clone "$url" "$SRC" || exit 1 ;; - (get) if [ -f "$PKG/tar" ] then "$0" tar "$2" && exit 0 @@ -39,16 +36,14 @@ case "$1" in else exit 1 fi ;; - (build) [ -d "$SRC" ] || "$0" get "$2" || exit 1 - mkdir -p "$OPT" - export CFLAGS="-I'$SYSROOT/include'" export LDFLAGS="-L'$SYSROOT/lib'" export PREFIX="$OPT" + mkdir -p "$OPT" cd "$SRC" || exit 1 if [ -f "$PKG/build" ] @@ -61,19 +56,16 @@ case "$1" in cd "$SRC" && make && make PREFIX="$PREFIX" install || exit 1 fi ;; - (add) [ -d "$OPT" ] && exit 0 || "$0" build "$2" || { rm -r "$OPT"; exit 1; } (cd "$OPT" && find . -type d -exec mkdir -p "$SYSROOT/{}" ';') (cd "$OPT" && find . ! -type d -exec ln -sf "$OPT/{}" "$SYSROOT/{}" ';') ;; - (del) rm -rf "$OPT" "$SRC" find -L "$SYSROOT" -type l -exec rm {} + ;; - (*) exit 1 ;; diff --git a/bin/status b/bin/status @@ -1,5 +1,6 @@ #!/bin/sh +printf ' ' uptime | sed 's/.*: *//' | tr -d ',\n' printf ' ' @@ -23,6 +24,4 @@ esac | xargs printf ' %s%%' printf ' ' -date +'%Y/%m/%d %H:%M' | tr -d '\n' - -printf '\n' +date +'%Y/%m/%d %H:%M' diff --git a/bin/twt b/bin/twt @@ -0,0 +1,154 @@ +#!/bin/sh +# twtxt client in a single small POSIX shell script + +NICK=josuah +FEED=$HOME/var/srv/josuah.net/twtxt.txt +CONF=$HOME/etc/twt +CACHE=$HOME/.cache/twt + +awk_line=' +function bissextile(yrs) +{ + return yrs % 4 == 0 && (yrs % 100 != 0 || yrs % 400 == 0); +} + +function days_per_month(mth, yrs) +{ + if (mth == 2) + return 28 + bissextile(yrs); + else if (mth < 7) + return 30 + mth % 2; + else + return 30 + mth % 2; +} + +function to_sec(yrs, mth, day, hrs, min, sec) +{ + for (mth--; mth > 0; mth--) + day += days_per_month(mth, yrs); + for (yrs--; yrs >= 1970; yrs--) + day += 365 + bissextile(yrs); + return sec + 60 * (min + 60 * (hrs + (24 * day))); +} + +function to_date(fmt, sec) +{ + b = bissextile(1970); + for (yrs = 1970; sec >= 3600 * 24 * (365 + b); yrs++) { + b = bissextile(yrs); + sec -= 3600 * 24 * (365 + bissextile(yrs)); + } + d = days_per_month(1); + for (mth = 1; sec >= 3600 * 24 * d; mth++) { + d = days_per_month(mth); + sec -= 3600 * 24 * d; + } + for (day = 1; sec >= 3600 * 24; day++) + sec -= 3600 * 24; + for (hrs = 0; sec >= 3600; hrs++) + sec -= 3600; + for (min = 0; sec >= 60; min++) + sec -= 60; + return sprintf(fmt, yrs, mth, day, hrs, min, sec); +} + +function rfc3339(str) { + yrs = substr(str, 1, 4); + mth = substr(str, 6, 2); + day = substr(str, 9, 2); + hrs = substr(str, 12, 2); + min = substr(str, 15, 2); + sec = substr(str, 18, 2); + sub("^[^ ]+\\.[0-9]+", "", str); + off = substr(str, 1, 1) == "Z" ? 0 : substr(str, 1, 3); + return to_sec(yrs, mth, day, hrs, min, sec) - off * 3600; +} + +BEGIN { + "date +%z" | getline local; + sub("..$", "", local); +} + +/^20/ { + sec = rfc3339($1) + local * 3600; + sub("[^\t]*\t", "", $0); + sub(".*/", "", FILENAME); + printf("%s", to_date("%04d/%02d/%02d %02d:%02d:%02d", sec)); + printf(" %s %s\n", FILENAME, $0); +}' + +awk_show=' +{ + printf("%-60s %s %s\n", $3, $1, $2); + sub("[^ ]+ [^ ]+ [^ ]+ +", "", $0); + for (text = $0; length(text) > 74; sub(" *", "", text)) { + line = substr(text, 1, 74); + sub(" +[^ ]*$", "", line); + text = substr(text, length(line) + 1); + printf(" %s\n", line); + } + printf(" %s\n\n", text); +}' + +err() +{ + printf 'Error: %s\n' "$1" + exit 1 +} + +mkdir -p "$CACHE" +touch "$CONF" + +case "$1" in +(tweet) + [ $# -ne 2 ] && exec "$0" + msg=$(printf %s "$2" | sed 's|[^ ]*://[^ ]*|@<&>|' | tr '\n' ' ') + while read -r usr url + do + url=$(printf %s "$url" | sed 's/[&/\]/\\&/g') + new=$(printf %s "$usr" | sed 's/[&/\]/\\&/g') + usr=$(printf %s "$usr" | sed 's/./[&]/g') + msg=$(printf %s "$msg" | sed "s/@$usr/@<$new $url>/") + done < "$CONF" + printf '%s\t%s\n' "$(date +'%Y-%m-%dT%T%z' | sed 's/..$/:&/')" "$msg" \ + >> "$FEED" + ;; +(view) + [ $# -ne 2 ] && exec "$0" + [ -f "$CACHE/$2" ] || err "$2 feed not found, try update" + awk "$awk_line" "$CACHE/$2" | sort -r | awk "$awk_show" | $PAGER + ;; +(timeline) + [ $# -ne 1 ] && exec "$0" + ls "$CACHE"/* 2> /dev/null 1>&2 || err 'no feed found, try to update' + awk "$awk_line" "$CACHE"/* | sort -r | awk "$awk_show" | $PAGER + ;; +(update) + while read -r usr url + do curl -m 10 -#L "$url" > "$CACHE/$usr" || rm "$TWT_CACHE/$usr" & + done < "$CONF" + wait + ;; +(follow) + [ $# -ne 3 ] && exec "$0" + sed 's/[[:space:]].*//' "$CONF" | grep -Fqx "$2" && + err "already following $2" + printf '%s\t%s\n' "$2" "$3" >> "$CONF" + sort -uo "$CONF" "$CONF" + ;; +(unfollow) + [ $# -ne 2 ] && exec "$0" + sed 's/[[:space:]].*//' "$CONF" | grep -Fqx "$2" || + err "not following $2" + sed "/^$(printf %s "$2" | sed 's/./[&]/g')[[:space:]]/ d" "$CONF" | + sort -uo "$CONF" + ;; +(following) + [ $# -ne 1 ] && exec "$0" + sed -re's/[[:space:]]/ /' -e's/(.{11}[^ ]*) */ \1 @ /' "$CONF" + ;; +(*) + printf 'usage: twt tweet msg | view user | timeline | update\n' + printf ' follow user url | unfollow user | following\n' + ;; +esac diff --git a/bin/twtsh b/bin/twtsh @@ -1,151 +0,0 @@ -#!/bin/sh -# twtxt client in a single small POSIX shell script - -TWT_NICK=josuah -TWT_FILE=$HOME/var/srv/josuah.net/twtxt.txt -TWT_CONF=$HOME/etc/twtxt -TWT_CACHE=$HOME/var/cache/twtxt - -err() -{ - printf 'Error: %s\n' "$1" - exit 1 -} - -awk_date=' -function bissextile(yrs) -{ - return yrs % 4 == 0 && (yrs % 100 != 0 || yrs % 400 == 0); -} - -function days_per_month(mth, yrs) -{ - if (mth == 2) - return 28 + bissextile(yrs); - else if (mth < 7) - return 30 + mth % 2; - else - return 30 + mth % 2; -} - -function to_sec(yrs, mth, day, hrs, min, sec) -{ - for (mth--; mth > 0; mth--) - day += days_per_month(mth, yrs); - for (yrs--; yrs >= 1970; yrs--) - day += 365 + bissextile(yrs); - return sec + 60 * (min + 60 * (hrs + (24 * day))); -} - -function to_date(fmt, sec) -{ - b = bissextile(1970); - for (yrs = 1970; sec >= 3600 * 24 * (365 + b); yrs++) { - b = bissextile(yrs); - sec -= 3600 * 24 * (365 + bissextile(yrs)); - } - d = days_per_month(1); - for (mth = 1; sec >= 3600 * 24 * d; mth++) { - d = days_per_month(mth); - sec -= 3600 * 24 * d; - } - for (day = 1; sec >= 3600 * 24; day++) - sec -= 3600 * 24; - for (hrs = 0; sec >= 3600; hrs++) - sec -= 3600; - for (min = 0; sec >= 60; min++) - sec -= 60; - return sprintf(fmt, yrs, mth, day, hrs, min, sec); -} - -function rfc3339(str) { - yrs = substr(str, 1, 4); - mth = substr(str, 6, 2); - day = substr(str, 9, 2); - hrs = substr(str, 12, 2); - min = substr(str, 15, 2); - sec = substr(str, 18, 2); - sub("^[^ ]+\\.[0-9]+", "", str); - off = substr(str, 1, 1) == "Z" ? 0 : substr(str, 1, 3); - return to_sec(yrs, mth, day, hrs, min, sec) - off * 3600; -}' - -awk_line="$awk_date"' -BEGIN { "date +%z" | getline off; } -/^20/ { - sec = rfc3339($1) + off * 3600; - printf("%s", to_date("%04d/%02d/%02d %02d:%02d:%02d", sec)); - sub("[^\t]*\t", "", $0); - sub(".*/", "", FILENAME); - printf(" %s %s\n", FILENAME, $0); -}' - -awk_show=' -{ - printf("%s - %s %s\n", $3, $1, $2); - sub("[^ ]+ [^ ]+ [^ ]+ +", "", $0); - for (text = $0; length(text) > 72; sub(" *", "", text)) { - line = substr(text, 1, 72); - sub(" +[^ ]*$", "", line); - text = substr(text, length(line) + 1); - printf(" %s\n", line); - } - printf(" %s\n\n", text); -}' - -mkdir -p "$TWT_CACHE" -touch "$TWT_CONF" - -case "$1" in -(tweet) - [ $# -ne 2 ] && exec "$0" - [ "${#2}" -eq 0 ] && err 'Empty tweet.' - msg=$(printf %s "$2" | sed 's|[^ ]*://[^ ]*|@<&>|') - while read -r usr url - do - new=$(printf %s "$usr" | sed 's/[&/\]/\\&/g') - usr=$(printf %s "$usr" | sed 's/./[&]/g') - url=$(printf %s "$url" | sed 's/[&/\]/\\&/g') - msg=$(printf %s "$msg" | sed "s/@$usr/@<$new $url>/") - done < "$TWT_CONF" - printf '%s\t%s\n' "$(date +'%Y-%m-%dT%T%z' | sed 's/..$/:&/')" "$msg" | - tr '\n' ' ' >> "$TWT_FILE" - ;; -(view) - [ $# -ne 2 ] && exec "$0" - [ -f "$TWT_CACHE/$2" ] || err "$2 feed not found. update and try again" - awk "$awk_line" "$TWT_CACHE/$2" | sort -r | awk "$awk_show" | $PAGER - ;; -(timeline) - [ $# -ne 1 ] && exec "$0" - touch "$TWT_CACHE"/* || err 'no feed found. update and try again' - awk "$awk_line" "$TWT_CACHE"/* | sort -r | awk "$awk_show" | $PAGER - ;; -(update) - while read -r usr url - do curl -#L "$url" > "$TWT_CACHE/$usr" || rm "$TWT_CACHE/$usr" & - done < "$TWT_CONF" - wait - ;; -(follow) - [ $# -ne 3 ] && exec "$0" - sed 's/[ ].*//' "$TWT_CONF" | grep -Fqx "$2" && - err "already following the user $2" - printf '%s\t%s\n' "$2" "$3" >> "$TWT_CONF" - sort -u "$TWT_CONF" -o "$TWT_CONF" - ;; -(unfollow) - [ $# -ne 2 ] && exec "$0" - tr '\t' ' ' | sed 's/ .*//' "$TWT_CONF" | grep -Fx "$2" || - err "not folling $2" - ;; -(following) - [ $# -ne 1 ] && exec "$0" - tr '\t' ' ' < "$TWT_CONF" | - sed -r -e 's/ / /' -e 's/(.{10}[^ ]*) */ \1 @ /' - ;; -(*) - printf 'usage: twtsh tweet msg | view user | timeline | update\n' - printf ' follow user url | unfollow user | following\n' - ;; -esac diff --git a/dot/gitconfig b/config/git/config diff --git a/darkhttpd/start b/darkhttpd/start @@ -1 +0,0 @@ -darkhttpd "$VAR/www" --default-mimetype text/plain & PID=$! diff --git a/devel/git/bin/git-index b/devel/git/bin/git-index @@ -1,109 +0,0 @@ -NAME="${1##*/}" -HEADER='<!doctype html><html> -<head> -<meta charset="utf-8"/> -<style> pre { float: left; margin: 4em 0 4em 4em; } </style> -</head> -<body> -<pre> -<h1><a href="..">&lt;</a> '"$NAME"'</h1> - -' - -FOOTER=' -</pre> -</body> -</html>' - -export LC_COLLATE=C - -mkdir -p "$NAME/commit" "$NAME/file" -cd "$NAME" || exit 1 - -# --- ./index.html --------------------------------------------------------------- - -{ - printf '%s\n' "$HEADER" - - git -C "$1" ls-tree -r --name-only master | sort | awk '{ - gsub("&", "\&amp;"); gsub("<", "\&lt;") - do { print } while (sub("/[^/]*$", "")) - }' | sort -u | awk '{ - count = split($0, line, "/") - for (i = 1; i <= count; i++) { - lines[NR"]["0] = $0 - lines[NR"]["i] = "| " - prev[i] = line[i] - } - lines[NR"]["i - 1] = "|-- " - prev[i] = "" - } END { - for (i = 1; !stop; i++) { - stop = tail = 1 - for (l = NR - 1; l > 0; l--) { - if (lines[l"]["i] == "| " && tail) { - lines[l"]["i] = " " - stop = 0 - - } else if (lines[l"]["i] == "|-- " && tail) { - lines[l"]["i] = "`-- " - tail = stop = 0 - - } else if (!lines[l"]["i]) { - tail = 1 - } - } - } - - for (l = 1; l < NR; l++) { - for (i = 1; lines[l"]["i]; i++) - printf "%s", lines[l"]["i] - printf "<a href=\"file/%s\">", lines[l"]["0] - sub(".*/|^", "", lines[l"]["0]) - printf "%s</a>\n", lines[l"]["0] - } - }' - - printf '</pre><pre>' - - git -C "$1" log --graph --date=short --format='%H %cd %cn <%ce>%n%s%n' | - sed -r ' - s|&|\&amp;|g - s|<|\&lt;|g - s|([0-9a-f]{8})([0-9a-f]{32})|<a href="commit/\1\2.html">\1</a>| - ' - - printf %s "$FOOTER" - -} > index.html - -# --- ./file/ ------------------------------------------------------------------ - -git -C "$1" ls-tree -r --name-only master | while IFS='' read -r file -do - [ "$1/$file" -ot "file/$file" ] && continue - echo "file $file" - mkdir -p "file/$(dirname "$file")" - git -C "$1" show master:"$file" > "file/$file" -done - -# --- ./commit/ ------------------------------------------------------------------- - -for commit in $(git -C "$1" log --format='%H') -do - [ -f "commit/$commit.html" ] && continue - echo "commit $commit" - echo "$HEADER" > "commit/$commit.html" - git -C "$1" show --stat -U3 "$commit" | sed ' - s|&|\&amp;|g - s|<|\&lt;|g - s|^[A-Z][a-z]*:|<b>&</b>| - /^commit/ s|.*|<b>&</b>| - /^diff/ s|.*|<b>&</b>| - /^+/ s|.*|<span style="color: green;">&</span>| - /^-/ s|.*|<span style="color: red;" >&</span>| - /^@/ s|.*|<b style="color: blue;" >&</b>| - /^---$/, /^$/ s|(\+*)(-*)$|<span class="r">\1</span><span class="b">\2</span>| - ' >> "commit/$commit.html" - echo "$FOOTER" >> "commit/$commit.html" -done diff --git a/dot/mbsyncrc b/dot/mbsyncrc @@ -1,19 +0,0 @@ -IMAPAccount mail@josuah.net -Host mail.gandi.net -User mail@josuah.net -PassCmd "printf '\\npass: ' 1>&2; stty -echo; sed q | tr -d '\\n'; stty sane" - -IMAPStore gandi-remote -Account mail@josuah.net - -MaildirStore gandi-local -Path ~/var/mail/ -Inbox ~/var/mail/INBOX - -Channel mail@josuah.net -Master :gandi-remote: -Slave :gandi-local: -Patterns * -Create Both -Expunge Both -SyncState * diff --git a/dot/profile b/dot/profile @@ -7,12 +7,12 @@ export PAGER="less" MANPAGER="$PAGER" export ENV="$HOME/.bashrc" export MAIL="$HOME/var/mail/INBOX" -export PATH="$HOME/etc/bin:$HOME/usr/bin:$PATH" +export PATH="$HOME/etc/bin:$HOME/.local/bin:$PATH" export MANPATH="$HOME/etc/man:/usr/share/man:/usr/local/man" -export MANPATH="$HOME/usr/share/man:$MANPATH" -export C_INCLUDE_PATH="$HOME/usr/include" -export LIBRARY_PATH="$HOME/usr/lib:/usr/local/lib/inotify" -export LD_LIBRARY_PATH="$HOME/usr/lib:/usr/local/lib/inotify" +export MANPATH="$HOME/.local/share/man:$MANPATH" +export C_INCLUDE_PATH="$HOME/.local/include" +export LIBRARY_PATH="$HOME/.local/lib:/usr/local/lib/inotify" +export LD_LIBRARY_PATH="$HOME/.local/lib:/usr/local/lib/inotify" export LANG=en_US.UTF-8 export LC_LC_COLLATE=C diff --git a/io/gopher b/io/gopher @@ -12,3 +12,4 @@ gopher://jgw.mdns.org/7/.bin-cgi/gophermap.dcgi gopher://gopher.raumzeitlabor.org/1 gopher://gopher.leveck.us/1/cgi-bin/pg gopher://tx.god.jp/1 +gopher://drkhsh.at/ diff --git a/libbearssl/bin/irc b/libbearssl/bin/irc @@ -1,56 +0,0 @@ -# Irc client in less than 300 lines of shell script - -# With help of http://xero.nu, inspired by http://tools.suckless.org/ii - -NICK="${NICK-$(whoami)}" -FULLNAME='With netcat and a script as a client' -NICK_LEN=12 -NL=' -' CR="$(printf '\015')" C_A="$(printf '\001')" -DIR="$HOME/.cache/irc" - - -# Write a message to a server - -local srv="$1" msg="$2" - -printf '\r%s\n' "$msg" >> "$srv/IN" - - -# Start netcat, identify the client and user, and monitor the response. - -mkdir -p "$VAR/irc/$1" -[ -p "$srv/in" ] || mkfifo "$srv/in" - -# Connect to irc server, send command from the pipe, parse the messages. -tail -f "$1/in" | brssl client "$srv":6667 | while IFS= read -r msg -do - printf %s "$msg" | awk -v srv="$1" ' - /^PING/ { - sub("PING", "PONG") - print > "in" - next - } - { print } - ' -done & - -echo "NICK $user" > "$1/in" -echo "USER $user +i * :$FULLNAME" > "$1/in" - - -# Maintain the connection open and print formatted message -# -# message = [ ":" prefix SPACE ] command [ params ] crlf -# prefix = servername / ( nickname [ [ "!" user ] "@" host ] ) -# command = 1*letter / 3digit -# params = *14( SPACE middle ) [ SPACE ":" trail ] -# =/ 14( SPACE middle ) [ SPACE [ ":" ] trail ] -# -# nospcrlfcl = %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF -# ; any octet except NUL, CR, LF, " " and ":" -# middle = nospcrlfcl *( ":" / nospcrlfcl ) -# trail = *( ":" / " " / nospcrlfcl ) -# -# SPACE = %x20 ; space character -# crlf = %x0D %x0A ; "carriage return" "linefeed" diff --git a/package/dwm/config.h b/package/dwm/config.h @@ -1,125 +1,124 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const char font[] = "terminus:pixelsize=18"; -static const char *fonts[] = { font }; -static const char normbordercolor[] = "#444444"; -static const char normbgcolor[] = "#000000"; -static const char normfgcolor[] = "#888888"; -static const char selbordercolor[] = "#888888"; -static const char selbgcolor[] = "#000000"; -static const char selfgcolor[] = "#ffffff"; static const unsigned int borderpx = 2; /* border pixel of 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 */ +static const char *fonts[] = { "terminus:pixelsize=18" }; +static const char dmenufont[] = "terminus:pixelsize=18"; +static const char col_gray1[] = "#222222"; +static const char col_gray2[] = "#444444"; +static const char col_gray3[] = "#bbbbbb"; +static const char col_gray4[] = "#eeeeee"; +static const char col_cyan[] = "#005577"; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +}; /* tagging */ -static const char *tags[] = { - "1:dev", "2:term", "3:irc", "4:doc", "5:web", "6:media", "7:gui" -}; +static const char *tags[] = { "1", "2", "3", "4:web", "5:graph" }; static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating monitor */ - { "Zathura", NULL, NULL, 1 << 3, 0, -1 }, - { "MuPDF", NULL, NULL, 1 << 3, 0, -1 }, - { "Chromium", NULL, NULL, 1 << 4, 0, -1 }, - { "Iceweasel", NULL, NULL, 1 << 4, 0, -1 }, - { "Firefox", NULL, NULL, 1 << 4, 0, -1 }, - { "Surf", NULL, NULL, 1 << 4, 0, -1 }, - { "Midori", NULL, NULL, 1 << 4, 0, -1 }, - { "ffplay", NULL, NULL, 1 << 5, 0, -1 }, - { "MPlayer", NULL, NULL, 1 << 5, 0, -1 }, - { NULL, "libreoffice", NULL, 1 << 6, 0, -1 }, - { "Blender", NULL, NULL, 1 << 6, 0, -1 }, - { "Gimp", NULL, NULL, 1 << 6, 0, -1 }, + /* class instance title tags mask isfloating monitor */ + { "Chromium", NULL, NULL, 1 << 3, 0, -1 }, + { "Iceweasel", NULL, NULL, 1 << 3, 0, -1 }, + { "Firefox", NULL, NULL, 1 << 3, 0, -1 }, + { "Surf", NULL, NULL, 1 << 3, 0, -1 }, + { "Midori", NULL, NULL, 1 << 3, 0, -1 }, + { "Zathura", NULL, NULL, 1 << 4, 0, -1 }, + { "MuPDF", NULL, NULL, 1 << 4, 0, -1 }, + { "ffplay", NULL, NULL, 1 << 4, 0, -1 }, + { "MPlayer", NULL, NULL, 1 << 4, 0, -1 }, + { NULL, "libreoffice", NULL, 1 << 4, 0, -1 }, + { "Blender", NULL, NULL, 1 << 4, 0, -1 }, + { "Gimp", NULL, NULL, 1 << 4, 0, -1 }, }; /* layout(s) */ -static const float mfact = 0.5; /* factor of master area [0.05..0.95] */ +static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 0; /* 1 to respect size hints */ +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ static const Layout layouts[] = { /* symbol arrange function */ - { "├┤│", tile }, /* first entry is default */ - { "│f│", NULL }, /* NULL means floating */ - { "│ │", monocle }, + { "[t]", tile }, /* first entry is default */ + { "[f]", NULL }, /* no layout function means floating behavior */ + { "[m]", monocle }, }; /* key definitions */ #define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, /* helper for spawning shell commands in the pre dwm-5.0 fashion */ #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } /* commands */ -static char dmenumon[2] = "0"; /* for dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { - "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", - normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL -}; -static const char *termcmd[] = { "st", "-f", font, NULL }; +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *termcmd[] = { "st", NULL }; static Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_space, spawn, {.v = dmenucmd } }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY|ShiftMask, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY, XK_BackSpace, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY, XK_Escape, quit, {0} }, + /* modifier key function argument */ + { MODKEY, XK_space, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY, XK_BackSpace, killclient, {0} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY, XK_Escape, quit, {0} }, }; /* button definitions */ -/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or - * ClkRootWin */ +/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { - /* click event button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; + diff --git a/package/dwm/git b/package/dwm/git @@ -0,0 +1 @@ +git://git.suckless.org/dwm diff --git a/package/dwm/tar b/package/dwm/tar @@ -1 +0,0 @@ -http://dl.suckless.org/dwm/dwm-6.1.tar.gz diff --git a/services/u9fs b/services/u9fs @@ -1 +0,0 @@ -9fs 564/tcp 9fs # Plan 9 fs diff --git a/text/iomenu/bin/io-ps b/text/iomenu/bin/io-ps @@ -1,4 +0,0 @@ -ps -ax | -sed -e '/]$/ d' -e '1 s/./#/' | -iomenu -p ps -# | -sed -r 's/^[^ ]* *([0-9]*).*/\1/' diff --git a/twt b/twt diff --git a/twtxt b/twtxt @@ -1,2 +0,0 @@ -technomancy https://technomancy.us/twtxt.txt -twtxt https://buckket.org/twtxt_news.txt