dot

packages and services management
Log | Files | Refs | README

commit 8aaf46dd20e788d977e6e9e9ce9b0a29b1d23632
parent 54b42395055aaec9518d8744f862853190079699
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  9 Sep 2018 17:42:15 +0200

add a basic tmux config file

Diffstat:
Mbin/put | 4+---
Mbin/session | 17+++++------------
Mbin/tmp | 7++++++-
Adot/bash_profile | 3+++
Adot/tmux.conf | 12++++++++++++
5 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/bin/put b/bin/put @@ -1,6 +1,5 @@ -#!/bin/sh +#!/usr/bin/awk -f -awk ' BEGIN { if (ARGC == 1) ARGV[++ARGC] = "/dev/stdin" printf("\033[30;1m────────────────────────────────────────────────────────────────────────────────\033[m\n"); @@ -23,4 +22,3 @@ FNR == 1 { END { printf("\033[30;1m───────┴────────────────────────────────────────────────────────────────────────\033[m\n"); } -' "$@" | less -RSX diff --git a/bin/session b/bin/session @@ -1,7 +1,7 @@ #!/bin/sh -e -# wrapper over abduco for supporting any length session names +# wrapper over abduco for supporting any session names -test $# = 1 && exec echo 'usage: session <name> <cmd> [<args>...] <filename>' +test $# = 1 && exec echo 'usage: session <name> <cmd> [<args>...]' mkdir -p "$HOME/.abduco" touch "$HOME/.abduco/names" @@ -14,19 +14,12 @@ else true >"$HOME/.abduco/names" fi test $# = 0 && exec cut -f 2 "$HOME/.abduco/names" +test "$1" || exit 1 -# get the real path name -name=$1 -test -h "$1" && name=$(readlink -f $1) -test -e "$1" && name=$(cd "$(dirname "$1")"; pwd)/$(basename "$1") -test -d "$1" && name=$(cd "$1"; pwd)/ -shift - +name=$(readlink -f "$1") hash=$(printf %s "$name" | cksum | cut -d ' ' -f 1) printf '%s\t%s\n' "$hash" "$name" >>"$HOME/.abduco/names" - -#test "$ABDUCO" && ABDUCO=$name exec abduco -n "$hash" "$@" - printf '\033]0;%s\a' "$name" >&2 +shift ABDUCO=$name exec abduco -A "$hash" "$@" diff --git a/bin/tmp b/bin/tmp @@ -1,5 +1,7 @@ #!/bin/sh -e +if test $# -gt 1; then; for x in "$@"; do "$0" "$1"; shift; done; fi + case "$1" in (*.mp3|*.mp4|*.ogg|*.flac|*.opus) type=music @@ -10,12 +12,15 @@ case "$1" in (*.pdf|*.ps|*.djvu) type=doc ;; -(*.iso|*.fs) +(*.iso|*.fs|*.img) type=iso ;; (*.txt|*.md) type=text ;; +(*.tar.??|*.tar.???) + type=tar + ;; esac test "$type" || exit 1 diff --git a/dot/bash_profile b/dot/bash_profile @@ -0,0 +1,3 @@ +. "$HOME/.profile" + +PS1='\[\033[1;$(test $? = 0 && echo 32 || echo 31)m\]\t \[\033[0;1m\]\h\[\033[34m\]\$\[\033[m\] ' diff --git a/dot/tmux.conf b/dot/tmux.conf @@ -0,0 +1,12 @@ +set -g prefix C-Space +bind C-Space send-prefix + +set-window-option -g mode-keys vi + +bind -T root M-p if-shell -F "#{alternate_on}" \ + "send-keys M-p" \ + "copy-mode -e; send-keys -X page-up" + +bind -T root M-n if-shell -F "#{alternate_on}" \ + "send-keys M-n" \ + "copy-mode -e; send-keys -X page-down"