dot

packages and services management
Log | Files | Refs | README

commit b831b0626e7251a5b27a927ceab5281478f3c2d8
parent 30d348cb7709b872bba57dda9488ab0b2813f649
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 19 Dec 2017 18:03:14 +0100

split files in multiple scripts

Diffstat:
Dbin/README | 11-----------
Dbin/acme | 3---
Abin/curl-0x0 | 2++
Abin/curl-ip | 3+++
Abin/curl-ix | 2++
Abin/curl-rfc | 2++
Abin/curl-sprunge | 2++
Abin/curl-w1r3 | 2++
Abin/curl-wttr | 2++
Dbin/http | 33---------------------------------
Mbin/io | 31++++++++++++++++++++++---------
Mbin/l | 4++--
Mbin/mv-sane | 2+-
Mbin/play | 2+-
Rbin/pst -> bin/ssh-paste | 0
Dbin/term | 11-----------
Abin/term-inv | 3+++
Abin/term-name | 3+++
Dbin/txt | 94-------------------------------------------------------------------------------
Mdot/profile | 5++---
Apack/catpoint/git | 1+
Mpack/dwm/config.h | 6+++---
22 files changed, 53 insertions(+), 171 deletions(-)

diff --git a/bin/README b/bin/README @@ -1,11 +0,0 @@ -#!/bin/sh -bin - shell scripts --------------------------------------------------------------------------------- - -Collection of wrappers and other POSIX sh scripts. - ---- 1 -- system programs ------------------------------------------------------- - -[package] A package manager that download program from an url in ~/pkg/tar -or ~/pkg/git into ~/src/<package>, then compile it in ~/opt/<package>, to -finally symlink it in ~/usr. diff --git a/bin/acme b/bin/acme @@ -1,3 +0,0 @@ -#!/bin/sh - -exec "$PLAN9/bin/acme" -f "$PLAN9/font/pelm/unicode.9.font" diff --git a/bin/curl-0x0 b/bin/curl-0x0 @@ -0,0 +1,2 @@ +#!/bin/sh +curl -F file=@- 0x0.st diff --git a/bin/curl-ip b/bin/curl-ip @@ -0,0 +1,3 @@ +#!/bin/sh + +curl icanhazip.com diff --git a/bin/curl-ix b/bin/curl-ix @@ -0,0 +1,2 @@ +#!/bin/sh +curl -F f:1=@- ix.io diff --git a/bin/curl-rfc b/bin/curl-rfc @@ -0,0 +1,2 @@ +#!/bin/sh +curl -L "http://www.ietf.org/rfc/rfc$2".txt | $PAGER diff --git a/bin/curl-sprunge b/bin/curl-sprunge @@ -0,0 +1,2 @@ +#!/bin/sh +curl -F sprunge=@- sprunge.us diff --git a/bin/curl-w1r3 b/bin/curl-w1r3 @@ -0,0 +1,2 @@ +#!/bin/sh +curl -F upload=@- w1r3.net diff --git a/bin/curl-wttr b/bin/curl-wttr @@ -0,0 +1,2 @@ +#!/bin/sh +curl wttr.in diff --git a/bin/http b/bin/http @@ -1,33 +0,0 @@ -#!/bin/sh -# client to various http services - -case $1 in -(0x0) - curl -F file=@- 0x0.st - ;; -(ip) - curl icanhazip.com - ;; -(ix) curl -F f:1=@- ix.io - ;; -(rfc) - curl -L "http://www.ietf.org/rfc/rfc$2".txt | - awk -v RS='\n*[^\n]*\n\f\n[^\n]*\n*' '{ print $0 }' | $PAGER - ;; -(sprunge) - curl -F sprunge=@- sprunge.us - ;; -(w1r3) - curl -F upload=@- w1r3.net - ;; -(wttr) - curl wttr.in - ;; -(1337) - nc 0x1A4.1337.cx 9998 - ;; -(*) - printf 'usage: http [0x0 | ip | ix | rfc num | sprunge | w1r3 | wttr\n' - printf ' [< data]]\n' - ;; -esac diff --git a/bin/io b/bin/io @@ -2,13 +2,26 @@ export LC_COLLATE=C -name=$({ - xdg-open - printf -- '#----------------------------------------' - printf -- '----------------------------------------\n' - find "$PWD" '(' -name .git -o -name CVS ')' -prune -o -print | sort -} | iomenu -# | cut -f 2) +mkdir -p "$HOME/.cache/find" +cache=$HOME/.cache/find/$(printf %s "${PWD##$HOME/}" | sed "s|/.*||") +find='( -name .git -o -name CVS ) -prune -o -print' -clear - -exec xdg-open "$name" +exec xdg-open "$(iomenu -# << EOF | cut -f 2 +$(xdg-open) +#------------------------------------------------------------------------------- +$( +case $PWD in +($HOME) + find . -maxdepth 1 -mindepth 1 \ + -exec test -f .cache/find/{} ';' -exec cat .cache/find/{} ';' + ;; +($HOME/*) + find "$PWD" $find | tee "$cache" + ;; +(*) + find "$PWD" -maxdepth 3 $find + ;; +esac | sort +) +EOF +)" diff --git a/bin/l b/bin/l @@ -1,4 +1,4 @@ #!/bin/sh -pwd -ls -Alp "$@" | column +printf '\033[H\033[J\033[1m%s\033[m %s\n' "$PWD" "$(git-status)" +ls -p "$@" diff --git a/bin/mv-sane b/bin/mv-sane @@ -3,7 +3,7 @@ find . -depth -exec sh -c ' old=$(basename "$0") - new=$(basename "$0" | tr -d "\\n" | tr -c "[:alnum:],." "_" | + new=$(basename "$0" | tr -d "\\n" | tr -c " \"\\\\$;(),." "_" | sed -r -e "s/_+/_/g" -e "s/([0-9]+)\\.*_/\\1_/") dir=$(dirname "$0") diff --git a/bin/play b/bin/play @@ -3,4 +3,4 @@ IFS=' ' -mplayer $(exec find "$1" -type f | sort) +mplayer -quiet $(exec find "$1" -type f | sort) diff --git a/bin/pst b/bin/ssh-paste diff --git a/bin/term b/bin/term @@ -1,11 +0,0 @@ -#!/bin/sh - -case $1 in -(inv) - [ $# = 1 ] && printf '\033[?5%s' h || printf '\033[?5%s' l - ;; -(name) - shift - printf '\033]0;%s\a' "$*" - ;; -esac diff --git a/bin/term-inv b/bin/term-inv @@ -0,0 +1,3 @@ +#!/bin/sh + +[ $# = 1 ] && printf '\033[?5%s' h || printf '\033[?5%s' l diff --git a/bin/term-name b/bin/term-name @@ -0,0 +1,3 @@ +#!/bin/sh + +printf '\033]0;%s\a' "$*" diff --git a/bin/txt b/bin/txt @@ -1,94 +0,0 @@ -#!/bin/sh -awk -F '\0' ' - -# title - -FNR == 1 { - print - for (i = 0; i < 80; i++) - printf "-" - print "" - - if (getline && $0 ~ "^-+$" || $0 ~ "^[ \t]*$") - next -} - -# litterals - -/^\t/ { - print "" - do { - print - } while (getline && $0 ~ "^\t") - next -} - -# blanks - -/^[\t ]*$/ { - next -} - -# heading - -sub("^---", "", $0) { - d = 0 - - # parse - while (sub("[0-9#]+\\.", "", $0)) d++ - if (sub("[0-9#]+", "", $0)) d++ - for (; d < depth; depth--) - levels[depth] = 0 - depth = d - sub("^[-. ]*", "", $0) - sub(" *-* *$", "", $0) - - # print - row = "--- " - for (d = 1; d < depth; d++) - row = row levels[d] "." - row = row "" ++levels[d] " -- " $0 " " - for (i = length(row); i < 80; i++) - row = row "-" - - print "\n" row - next -} - -# links - -/^[0-9#]+: / { - print "" - do { - print - } while (getline && $0 ~ "^[0-9]+: ") - next -} - -# paragraph - -{ - do { - block = block " " $0 - } while (getline && $0 !~ "^[ \t]*$") - - sub("^[\t ]*", "", block) - gsub("[\t ]+", " ", block) - gsub("\\. ", ". ", block) - gsub("\\? ", "? ", block) - gsub("\\! ", "! ", block) - - width = 80 - margin[block] - - print "" - while (length(block) > 0) { - row = substr(block, 1, width) - if (length(row) >= width) - sub(" [^ ]*$", "", row) - - block = substr(block, length(row) + 1) - sub(" *", "", block) - - print row - } -}' "$@" diff --git a/dot/profile b/dot/profile @@ -5,7 +5,7 @@ export EMAIL="mail@josuah.net" export MAILTO="$EMAIL" export EDITOR="edit" VISUAL="edit" -export PAGER="tee" MANPAGER="ul" +export PAGER="less" MANPAGER="less" export MAIL="$HOME/var/mail/mbox" export MAILDIR="$HOME/var/mail" @@ -37,5 +37,4 @@ export PKG_PATH="https://ftp.fr.openbsd.org/pub/OpenBSD/" export SSH_AUTH_SOCK="$HOME/.cache/ssh-agent" -[ "$SSH_TTY" ] && PS1="$(uname -n)% " || PS1="% " -export PS1 +PS1="$(printf '\033]0;$PWD $(git-status)\a')${SSH_TTY:+$(uname -n)}% " diff --git a/pack/catpoint/git b/pack/catpoint/git @@ -0,0 +1 @@ +git://git.2f30.org/catpoint.git diff --git a/pack/dwm/config.h b/pack/dwm/config.h @@ -5,8 +5,8 @@ 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 *fonts[] = { "terminus:bold:pixelsize=18" }; +static const char dmenufont[] = "terminus:bold:pixelsize=18"; static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; @@ -19,7 +19,7 @@ static const char *colors[][3] = { }; /* tagging */ -static const char *tags[] = { "1:acme", "2", "3", "4:web", "5:graph" }; +static const char *tags[] = { "1:text", "2:term", "3:ssh", "4:web", "5:graph" }; static const Rule rules[] = { /* xprop(1):