dot

packages and services management
Log | Files | Refs | README

commit e7c1290ee60b12e1f1edb873e98c617d51e74bd2
parent e7bd11763549551ea80d661601404a899814b4e4
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Sat, 12 Aug 2017 10:56:14 +0200

housekeeping...

Diffstat:
Miomenu/bin/io | 13+++++++++----
Mless/profile | 2+-
Mshell/bin/adagio | 6+++---
Dshell/bin/txt | 58----------------------------------------------------------
4 files changed, 13 insertions(+), 66 deletions(-)

diff --git a/iomenu/bin/io b/iomenu/bin/io @@ -6,14 +6,14 @@ mkdir -p "$HOME/.abduco" touch "$HOME/.abduco/names" -# --- session name ------------------------------------------------------------- +# update session names for displaying them grep -F -e "$( abduco | awk -F '\t' 'NR > 1 { print $3 }' )" "$HOME/.abduco/names" | sort -uk 2,2 -o "$HOME/.abduco/names" -# --- arguments ---------------------------------------------------------------- +# build arguments if [ $# -gt 0 ] then @@ -30,14 +30,19 @@ else set -- $command "$path" fi -[ $# = 1 ] && set -- $EDITOR "$@" +[ -z "$path" ] && exit 1 +[ $# = 1 ] && set -- $EDITOR "$@" hash=$(printf %s "$path" | cksum | cut -d ' ' -f 1) + +# update session names with the new entry + printf '%s %s\n' "$hash" "$path" >> "$HOME/.abduco/names" sort -uk 2,2 "$HOME/.abduco/names" -o "$HOME/.abduco/names" -# --- attach ------------------------------------------------------------------- + +# create session or attach to it [ "$SSH_TTY" ] && e='^\' || e='^Z' [ "$ABDUCO" != "$hash" ] && ABDUCO=$hash exec abduco -e "$e" -A "$hash" "$@" diff --git a/less/profile b/less/profile @@ -1,2 +1,2 @@ -export LESS=-MISn +export LESS=-MIRSn export LESSCHARSET=utf-8 diff --git a/shell/bin/adagio b/shell/bin/adagio @@ -1,7 +1,7 @@ # Albinoni, Adagio fog G minor adapted to 'beep' -# notes frequencies ------------------------------------------------------------ +# notes frequencies C0=16 Cd0=17 Db0=17 D0=18 Dd0=19 Eb0=19 E0=21 F0=22 Fd0=23 Gb0=23 G0=25 Gd0=26 Ab0=26 A0=28 Ad0=29 Bb0=29 B0=31 @@ -23,7 +23,7 @@ C8=4186 Cd8=4435 Db8=4435 D8=4699 Dd8=4978 Eb8=4978 E8=5274 F8=5588 Fd8=5920 Gb8=5920 G8=6272 Gd8=6645 Ab8=6645 A8=7040 Ad8=7459 Bb8=7459 B8=7902 -# music score ------------------------------------------------------------------ +# music score # with $n the note from above, and $d the duration in millisecond. # Use '1' for silent note. @@ -229,7 +229,7 @@ main() read duration kill -9 "$pid" speaker-test -t sine -f $note & pid="$!" - sleep "`busybox dc "$duration" 10 / f`" + sleep "$(busybox dc "$duration" 10 / f)" done } diff --git a/shell/bin/txt b/shell/bin/txt @@ -1,58 +0,0 @@ -awk ' - -!BLOCK && /^$/ { next } - -BLOCK && /^$/ { - print "</" BLOCK ">\n" - BLOCK = "" - next -} - - -# --- print blocks ------------------------------------------------------------- - -!BLOCK && /^\t/ { - print "<pre>" - do { - sub("^\t", "", $0) - print $0 - } while (getline && $0 !~ /^[^\t]/) - print "</pre>" - BLOCK = "" -} - -!BLOCK && match($0, /^=+ /) { - sub(/^=* */, "", $0) - sub(/ *=*$/, "", $0) - print "\n<h" RLENGTH - 1 ">" $0 "</h" RLENGTH - 1 ">\n" - BLOCK = "" - next -} - - -# --- identify block ----------------------------------------------------------- - -!BLOCK && /^- / { - BLOCK = "li" - sub(/^- /, "", $0) -} - -!BLOCK { - BLOCK = "p" -} - - -# --- print identified blocks -------------------------------------------------- - -BLOCK { - print "<" BLOCK ">" $0 - next -} - -{ print } - -END { - if (BLOCK) print "</" BLOCK ">" - if (CONTEXT) print "</" CONTEXT ">" -} -' "$@"