dot

packages and services management
Log | Files | Refs | README

commit 4780f3e644cad992bfae5963dbfdc77bd9219643
parent 7237a1f8ccd18ac0f20a56d29a384cef422a11af
Author: josuah <mail@josuah.net>
Date:   Wed, 26 Oct 2016 13:48:17 -0400

Added session management and ditched tr for sed 'y///'

Diffstat:
MBUILD/dvtm | 2+-
Mbin/buffers | 39+++++++++++++++++++++++++++++++--------
Mdwm/config.h | 5+++--
Mshell/.profile | 3+++
Mst/config.h | 2+-
5 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/BUILD/dvtm b/BUILD/dvtm @@ -4,7 +4,7 @@ tar=http://github.com/martanne/dvtm/archive/master.tar.gz build() { - patch -p1 < "$CONFIG/$1/gaps.diff" + #patch -p1 < "$CONFIG/$1/gaps.diff" cp -f "$CONFIG/$1/config.h" . cp -f "$CONFIG/$1/dvtm-status" . diff --git a/bin/buffers b/bin/buffers @@ -3,10 +3,10 @@ # | \ | | | | |--' | `--. # ---' `--` ' ' `--' ' ---' 2016-10-08 #------------------------------------------------------------------------------- -# Run commands in detachable buffers +# Manage abduco sessions like buffers. # External: stest (dmenu), iomenu, abduco -# Busybox: mkdir, tee, sort, tr, sed +# Busybox: mkdir, tee, sort, sed help=' Usage: buffers COMMAND @@ -138,7 +138,7 @@ run() printf '\033]0;%s\007' "$name" # Remove forbidden characters - name="$(printf '%s' "$name" | tr '/' '!')" + name="$(printf '%s' "$name" | sed 'y/\//!/')" # Run new or existing abduco session with this name TERM=screen ABDUCO="$cmd" abduco -e '^z' -A "$name" $cmd $opt @@ -150,22 +150,42 @@ run() attach() { # If already on a session, print its name and exit. - [ "$ABDUCO" ] && printf '[ %s ]\n' "$ABDUCO" | tr '!' '/' && exit 1 + if [ "$ABDUCO" ] + then + printf '[ %s ]\n' "$ABDUCO" | sed 'y/!/\//' + exit 1 + fi # Overwrite the prompt. printf '\033[1A' # Get the session name by prompting the user. - name="$(abduco | sed 1d | sort -k 4 | tr ! / | iomenu | tr / !)" - name="${name##*$TAB}" + name="$( + abduco | + sed '/session/ d; y/!/\//' | + sort -k 4 | + iomenu | + sed 's/.*\t//; y/\//!/' + )" # Set the name of the terminal. - printf '\033]0;%s\007' "$name" | tr '!' '/' + printf '\033]0;%s\007' "$name" | sed 'y/!/\//' # Attach to the session. [ "$name" ] && TERM=screen ABDUCO="$name" abduco -e '^z' -a "$name" } +# +# Attach or create a master abduco session. +# +session() +{ + if [ -z "$SESSION" ] + then + SESSION='session' TERM='screen' abduco -e '^\' -A session + fi +} + # ALGORITHM #------------------------------------------------------------------------------- @@ -178,6 +198,9 @@ r | run ) a | attach ) attach ;; +s | session ) + session + ;; * ) printf '%s\n' "$help" exit 0 @@ -186,4 +209,4 @@ esac # Reset the screen, print reminder of current sessions printf '\033[2J\033[0;0f\033[0m\n' -abduco | tr '!' '/' | sort -t "$TAB" -k 3 | sed '1d; s/^/\t/' +abduco | sed 'y/!/\//' | sort -t "$TAB" -k 3 | sed '1d; s/^/\t/' diff --git a/dwm/config.h b/dwm/config.h @@ -2,9 +2,10 @@ /* appearance */ static const char *fonts[] = { - "monospace:pixelsize=13:antialias=false" + "terminus", + "monospace:pixelsize=13:antialias=false", }; -static const char dmenufont[] = "monospace:pixelsize=13:antialias=false"; +static const char dmenufont[] = "terminus"; static const char normbordercolor[] = "#999999"; static const char normbgcolor[] = "#000000"; static const char normfgcolor[] = "#999999"; diff --git a/shell/.profile b/shell/.profile @@ -121,3 +121,6 @@ then theme pink setfont "$CONFIG/fonts/terminus/ter-v16b.psf.gz" fi + +# Always run in an abduco session. +buffers session diff --git a/st/config.h b/st/config.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char font[] = "terminus"; +static char font[] = "terminus:pixelsize=14"; static int borderpx = 2; static char shell[] = "/bin/sh"; static char *utmp = NULL;