dot

packages and services management
Log | Files | Refs | README

commit 0279983361723c2a166d3b88789bf1cfb5ca9a27
parent a8e7e45a9587452539433e5c23d0242f1d706b41
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed,  7 Mar 2018 20:28:42 +0100

agenda needed an update

Diffstat:
Magenda/main | 10++++++++++
Mbin/agenda | 26++++++++++++--------------
Mbin/xdg-open | 7+++++--
3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/agenda/main b/agenda/main @@ -54,3 +54,13 @@ D:No de voyage: 7327231398974 D:Dortoir Partage, hommes uniquement D:1 lit superpose (1 place) Chambre non-fumeur : +B:1521315000 +E:1521315000 +S:Tête Ronde, Tête Pointue +C:animation +L:"La Caravane MJC" de Servon/Vilaine, Tour d'Argent 2016 +D:Invité par: " La Caravane MJC" de Servon/Vilaine, nous sommes très heureux +D:de présenter notre pièce TRTP .Tour d'Argent 2016 +D:A 20mn environ à l'Est de Rennes, c'est tout près. Nous, nous vous +D:attendrons pour 20H30 +: diff --git a/bin/agenda b/bin/agenda @@ -161,16 +161,16 @@ add="$date"' function parse(date) { - yrs = substr(DATE, 1, 4); - mth = substr(DATE, 6, 2); - day = substr(DATE, 9, 2); - hrs = substr(DATE, 12, 2); - min = substr(DATE, 15, 2); + yrs = substr(date, 1, 4); + mth = substr(date, 6, 2); + day = substr(date, 9, 2); + hrs = substr(date, 12, 2); + min = substr(date, 15, 2); return to_sec(yrs, mth, day, hrs, min, 0) - OFF * 3600; } BEGIN { - printf("B:%d\nE:%d\nS:\nC:\nL:\nD:\n:\n", parse(DATE1), parse(DATE2)); + printf("B:%d\nE:%d\nS:\nC:\nL:\nD:\n:\n", parse(DT1), parse(DT2)); }' list="$date"' @@ -191,13 +191,12 @@ mkdir -p "$AGENDA" case "$1" in (-i) [ "$#" = 4 ] || exec "$0" -h - awk -v OFF="$4" "$import" "$2" > "$AGENDA/$3" ;; (-a) + [ "$#" -le 3 ] || [ "$#" -ge 6 ] && exec "$0" -h + [ "$#" = 4 ] && set -- "$1" "$2" "$3" "$4" "$3" "$4" [ "$#" = 5 ] && set -- "$1" "$2" "$3" "$4" "$3" "$5" - [ "$#" = 6 ] || exec "$0" -h - off="$(date +%z | cut -c -3)" awk -v OFF="$off" -v DT1="$3-$4" -v DT2="$5-$6" "$add" >> "$AGENDA/$2" exec $EDITOR "$AGENDA/$2" @@ -212,11 +211,10 @@ case "$1" in find "$AGENDA" ! -type d ! -name '*.txt' -exec awk "$list" {} \; | sort ;; (*) - [ "$#" = 1 ] || [ "$#" = 2 ] && [ -f "$AGENDA/$1" ] || - exec cut -f 2- << 'EOF' 1>&2 - usage: agenda -a <name> YYYY/MM/DD HH:MM [YYYY/MM/DD] HH:MM - agenda -i <file.ics> <name> [+-]HH - agenda [<name> [BESCL]] + [ "$#" = 1 ] || [ "$#" = 2 ] && [ -f "$AGENDA/$1" ] || exec cat << EOF +usage: agenda -a <name> YYYY/MM/DD HH:MM [YYYY/MM/DD] HH:MM + agenda -i <file.ics> <name> [+-]HH + agenda [<name> [BESCL]] EOF awk -v SORT="${2:-BECLS}" "$sort" "$AGENDA/$1" | awk -v OFF="$(date +%z | cut -c 1-3)" "$view" | diff --git a/bin/xdg-open b/bin/xdg-open @@ -2,7 +2,7 @@ # override the xdg-open utility -[ -h "$1" ] && set -- "$(readlink "$1")" +[ -h "$1" ] && set -- "$(readlink -f "$1")" [ -e "$1" ] && set -- "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")" [ -d "$1" ] && set -- "$(cd "$1"; pwd)" @@ -183,6 +183,9 @@ case "$1" in (*://*) exec printf 'unsupported protocol\n' 1>&2 ;; +(*\([0-9]\)|*\([0-9]p\)) + exec man "${1%(*}" + ;; (*.torrent) exec transmission-cli "$1" ;; @@ -217,7 +220,7 @@ case "$1" in exec $play < "$1" ;; (*.webm|*.mp4|*.mkv|*.ogv|*.avi) - exec ffplay "$1" + exec ffplay -autoexit "$1" ;; (*/music/*) find "$1" -type f | sort | while IFS='' read -r song