dot

packages and services management
Log | Files | Refs | README

commit 6cc0f87e6dd2991623c68c91c459b73af44e4626
parent 01c6e8cdff9ca4ee5425e1278ac134c43fe5dfa8
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu, 12 Apr 2018 17:38:12 +0200

pack qemu

Diffstat:
Mbin/80 | 1+
Mbin/edit | 2++
Abin/markup-fmt | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mbin/markup-gopher | 4++--
Mbin/ssh-paste | 19++++++++++++++-----
Mbin/xdg-abduco | 4++--
Mbin/xdg-open | 2+-
Mmblaze/filter | 1+
Mpack/dwm/config.h | 6+-----
Dpack/dwm/tcl.c | 74--------------------------------------------------------------------------
Apack/qemu/build | 5+++++
Apack/qemu/tar | 1+
Mprofile | 5+++--
Rrun/qemu-tun/run -> run/qemu-tap/run | 0
14 files changed, 108 insertions(+), 91 deletions(-)

diff --git a/bin/80 b/bin/80 @@ -8,5 +8,6 @@ BEGIN { ARGC = 1 } line = $0; for (i = 80 - length($0); i > 0; i--) line = line ARGV[2]; + sub("^ ", ARGV[2], line); print line; }' - "${1:--}" diff --git a/bin/edit b/bin/edit @@ -6,6 +6,8 @@ # emacs(1)-style input key bindings for everything REPL. This also permit to # change the $EDITOR without reloading the environment variables. +export EXINIT='set ruler' + cd "$(dirname "$1")" exec vi "$(basename "$1")" diff --git a/bin/markup-fmt b/bin/markup-fmt @@ -0,0 +1,75 @@ +#!/usr/bin/awk -f + +function fold(block) +{ + while ((line = substr(block, 1, 80)) != "") { + sub(" +[^ ]*$", "", line); + print(line); + block = substr(block, length(line) + 1); + sub("^ *", "", block); + } +} + +function paragraph(block) +{ + print(""); + if (match(block, "^\\*\\*[^*]*\\*\\*:") { + print(substr(block, 1, RLENGTH)); + block = substr(block, RLENGTH + 1); + } + sub(" *$", "", block); + gsub(" +", " ", block); + fold(block); +} + +function title(block) +{ + fold(block); + half = "========================================"; + print(half half); +} + +function subtitle(str) +{ + printf("\n\n### "); + fold(str); +} + +BEGIN { + block = ""; +} + +/^[ \t]*$/ { + if (block) paragraph(block); + block = ""; next; +} + +/^\t+[^ \t]$/ { + while(match($0, /^\t+[^ \t]$/)) { + } + +} + +/^=+$/ { + if (block) title(block); + block = ""; next; +} + +/^-+$/ { + if (block) heading(block); + block = ""; next; +} + +sub(/^#+ *$/, "") { + if (block) paragraph(block); + subheading($0); + block = ""; next; +} + +{ + block = block " " $0; next; +} + +END { + if (block) paragraph(block); +} diff --git a/bin/markup-gopher b/bin/markup-gopher @@ -19,7 +19,7 @@ BEGIN { HOST = ARGV[1]; PORT = ARGV[2]; ARGV[1] = ARGV[3]; - ARGC = 1; + ARGC = 2; } match($0, "^\\[[^]]*\\]: ") { @@ -54,5 +54,5 @@ match($0, "^\\[[^]]*\\]: ") { { gsub("\t", " "); - print; + printf("i%s\t\t\t\n", $0); } diff --git a/bin/ssh-paste b/bin/ssh-paste @@ -1,8 +1,17 @@ #!/bin/sh -cat "$@" | ssh josuah@nas.josuah.net ' +host="josuah.net" +user="josuah" +path="var/pub/$host" + +path="$(cat "$@" | ssh "$user@$host" ' set -e - tmp=$(mktemp srv/p/XXXXXX) - cat > "$tmp" - printf %s "${tmp#srv/}" -' | sed 's|.*|gopher://nas.josuah.net/0/&|' + cd '"'$path'"' + p="$(mktemp p/XXXXXX)" + cat >"$p" + chmod 444 "$p" + printf %s "$p" +')" + +printf 'gopher://%s/0/%s\n' "$host" "$path" +printf 'http://%s/%s\n' "$host" "$path" diff --git a/bin/xdg-abduco b/bin/xdg-abduco @@ -20,7 +20,7 @@ grep -e "^$(abduco | sed -rn 's/.* ([0-9]+)$/\1/p') " "$dir/names" | name="$1" [ ! -h "$1" ] || name="$(readlink -f "$1")" [ ! -e "$1" ] || name="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")" -[ ! -d "$1" ] || name="$(cd "$1"; pwd)" +[ ! -d "$1" ] || name="$(cd "$1"; pwd)/" shift # set terminal title to the session name @@ -32,4 +32,4 @@ printf '%s\t%s\n' "$hash" "$name" >> "$dir/names" [ -z "$ABDUCO" ] && ABDUCO="$name" exec abduco -A "$hash" "$@" ABDUCO="$name" abduco -n "$hash" "$@" -printf '"%s" open in the background\n' "$name" +printf '%s: open in the background\n' "$name" diff --git a/bin/xdg-open b/bin/xdg-open @@ -217,6 +217,6 @@ case "$1" in ;; (*) [ -f "$1" ] && exec xdg-abduco "$1" $EDITOR "$1" - [ -d "$1" ] && cd "$1" && exec xdg-abduco "$1" "$SHELL" + [ -d "$1" ] && cd "$1" && exec xdg-abduco "$PWD" "$SHELL" ;; esac diff --git a/mblaze/filter b/mblaze/filter @@ -49,6 +49,7 @@ reddit.com "From" "*@redditmail.com*" researchgate.net "From" "*@researchgate.*" researchgate.net "From" "*@researchgatemail.*" sabotage.tech "Mailing-List" "*sabotage*@lists.openwall.com*" +skarnet.org "List-Post" "*@list.skarnet.org*" suckless.org "List-Id" "*suckless.org*" tarsnap.com "From" "*tarsnap.com*" transports "From" "*BlaBlaCar*" diff --git a/pack/dwm/config.h b/pack/dwm/config.h @@ -1,7 +1,5 @@ /* See LICENSE file for copyright and license details. */ -#include "tcl.c" - /* appearance */ static const unsigned int borderpx = 5; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ @@ -55,7 +53,6 @@ static const Layout layouts[] = { /* symbol arrange function */ { "[t]", tile }, /* first entry is default */ { "[f]", NULL }, /* no layout function means floating behavior */ - { "[w]", tcl }, { "[m]", monocle }, }; @@ -93,8 +90,7 @@ static Key keys[] = { { MODKEY, XK_BackSpace, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_w, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[3]} }, + { 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 } }, diff --git a/pack/dwm/tcl.c b/pack/dwm/tcl.c @@ -1,74 +0,0 @@ -void -tcl(Monitor * m) -{ - int x, y, h, w, mw, sw, bdw; - unsigned int i, n; - Client * c; - - for (n = 0, c = nexttiled(m->clients); c; - c = nexttiled(c->next), n++); - - if (n == 0) - return; - - c = nexttiled(m->clients); - - mw = m->mfact * m->ww; - sw = (m->ww - mw) / 2; - bdw = (2 * c->bw); - resize(c, - n < 3 ? m->wx : m->wx + sw, - m->wy, - n == 1 ? m->ww - bdw : mw - bdw, - m->wh - bdw, - False); - - if (--n == 0) - return; - - w = (m->ww - mw) / ((n > 1) + 1); - c = nexttiled(c->next); - - if (n > 1) - { - x = m->wx + ((n > 1) ? mw + sw : mw); - y = m->wy; - h = m->wh / (n / 2); - - if (h < bh) - h = m->wh; - - for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++) - { - resize(c, - x, - y, - w - bdw, - (i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw, - False); - - if (h != m->wh) - y = c->y + HEIGHT(c); - } - } - - x = (n + 1 / 2) == 1 ? mw : m->wx; - y = m->wy; - h = m->wh / ((n + 1) / 2); - - if (h < bh) - h = m->wh; - - for (i = 0; c; c = nexttiled(c->next), i++) - { - resize(c, - x, - y, - (i + 1 == (n + 1) / 2) ? w - bdw : w - bdw, - (i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw, - False); - - if (h != m->wh) - y = c->y + HEIGHT(c); - } -} diff --git a/pack/qemu/build b/pack/qemu/build @@ -0,0 +1,5 @@ +#!/bin/sh -ex + +./configure --prefix="$PREFIX" --python="$(command -v python3)" + +exec "$PACK/build/gmake" diff --git a/pack/qemu/tar b/pack/qemu/tar @@ -0,0 +1 @@ +https://download.qemu.org/qemu-2.12.0-rc3.tar.xz diff --git a/profile b/profile @@ -49,10 +49,11 @@ export TWT_FEED="$HOME/git/josuah.net/twtxt.txt" export SSH_AUTH_SOCK="/tmp/ssh-agent" +export TERM="screen" + export SVDIR="$HOME/run" -export TERM="screen" export PS1='$([ $? -gt 0 ] && printf "\033[31;1mx\033[m\\n\\r")'"$( [ "$(whoami)" = "root" ] && s='#' || s='$' - printf '\033]0;%s\a\n%s%s ' '$PWD' "$(uname -n)" "$s" + printf '\033]0;%s\a\n%s%s ' '$PWD/' "$(uname -n)" "$s" )" diff --git a/run/qemu-tun/run b/run/qemu-tap/run