dot

packages and services management
Log | Files | Refs | README

commit 86949b2d735ea7f924044dbac5f589577860be41
parent ead7c4205f543b5ddcdd80752938d770fb61f340
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 16 Mar 2018 19:07:06 +0100

fixing mfilter for sbase

Diffstat:
Mbin/io | 15++++++---------
Mbin/mfilter | 15+++++++++++----
Mbin/pack | 2+-
Mmblaze/filter | 1+
Mpack/dwm/build | 2+-
Mpack/dwm/config.h | 6+++++-
Apack/dwm/tcl.c | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 99 insertions(+), 16 deletions(-)

diff --git a/bin/io b/bin/io @@ -5,14 +5,11 @@ export LC_COLLATE='C' cache="$HOME/.cache/find" -mkdir -p "$cache" -case "$PWD" in -("$HOME"/*) - dir="$(printf %s "${PWD##$HOME/}" | sed 's:/.*::')" - find "$HOME/$dir" \( -name .git -o -name CVS \) -prune -o -print | - sort > "$cache/$dir" - ;; -esac +mkdir -p "$(dirname "$cache")" -exec xdg-open "$(sort "$cache"/* | cat - "$HOME/etc/uri" | iomenu -#)" +[ "$1" = -c ] || [ ! -f "$cache" ] && + find "$HOME" \( -name .git -o -name CVS \) -prune -o -print | + sort -o "$cache" + +exec xdg-open "$(cat "$cache" "$HOME/etc/uri" | iomenu)" diff --git a/bin/mfilter b/bin/mfilter @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/sh -e + # read and filter mails using mblaze +MBLAZE="${MBLAZE-$HOME/.mblaze}" + minc "$HOME/var/mail/INBOX" > "$HOME/.config/mblaze/seq.mfilter" [ "$1" = '-a' ] && @@ -13,6 +16,10 @@ do "$HOME/var/mail/$dir/new" \ "$HOME/var/mail/$dir/tmp" printf '%-35s' "$dir" 1>&2 - mpick -t "$header ~~~ $glob" < "$HOME/.config/mblaze/seq.mfilter" | - xargs -r {} mv {} "$HOME/var/mail/$dir/new" -done 2>&1 | sed 's/, 0 picked././' | less + mpick -t "$header ~~~ $glob" < "$MBLAZE/seq.mfilter" | + while IFS='' read -r file + do + new="$HOME/var/mail/$dir/new" + [ -z "${file##$new*}" ] || mv "$file" "$new" + done +done 2>&1 | sed 's/, 0 picked././' | $PAGER diff --git a/bin/pack b/bin/pack @@ -60,7 +60,7 @@ case "$1" in ;; (del) rm -rf "$PREFIX" - find -L "$PACKROOT" -name opt -prune -o -name src -prune -o \ + exec find -L "$PACKROOT" -name opt -prune -o -name src -prune -o \ -type l -exec rm {} + ;; (*) diff --git a/mblaze/filter b/mblaze/filter @@ -45,6 +45,7 @@ openbsd.org/announce "List-ID" "*announce.openbsd.org*" openbsd.org/tech "List-ID" "*tech.openbsd.org*" paypal.com "From" "*paypal.*" reddit.com "From" "*@reddit.*" +reddit.com "From" "*@redditmail.com" researchgate.net "From" "*@researchgate.*" researchgate.net "From" "*@researchgatemail.*" sabotage.tech "Mailing-List" "*sabotage*@lists.openwall.com*" diff --git a/pack/dwm/build b/pack/dwm/build @@ -1,6 +1,6 @@ #!/bin/sh -ex -cp -f "$PACK/dwm"/*.h . +cp -f "$PACK/dwm"/*.[ch] . cp -f "$PACK/dwm/config.mk" config.mk make PREFIX="$PREFIX" install diff --git a/pack/dwm/config.h b/pack/dwm/config.h @@ -1,5 +1,7 @@ /* 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 */ @@ -52,6 +54,7 @@ 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 }, }; @@ -89,7 +92,8 @@ static Key keys[] = { { 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, XK_w, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_m, setlayout, {.v = &layouts[3]} }, { 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 @@ -0,0 +1,74 @@ +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); + } +}