dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit fe5d67aabd3dd04128e3c8209dce7739bd7cf531
parent 10d30574c0b77b0dc61762aa84e21f510472b19f
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu,  3 Dec 2020 10:36:33 +0100

remove netcdf and hurl functions into separate scripts

Diffstat:
A.local/bin/gnuplotmatrix | 5+++++
A.local/bin/hurlo | 15+++++++++++++++
A.local/bin/ncplot | 2++
A.local/bin/ncshow | 2++
M.profile | 31-------------------------------
5 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/.local/bin/gnuplotmatrix b/.local/bin/gnuplotmatrix @@ -0,0 +1,5 @@ +#!/bin/sh +gnuplot -e 'set terminal pdf; + set xrange [*:*] noextend; + set yrange [*:*] noextend; + set size ratio -1; plot "-" matrix w image' diff --git a/.local/bin/hurlo b/.local/bin/hurlo @@ -0,0 +1,15 @@ +#!/bin/sh +if [ "$#" -lt 1 ]; then + cat +else + printf '%s\n' "$@" +fi | while read -r url; do + out="${url##*/}" + [ -z "$out" ] && out="hurl_out" + [ -e "$out" ] && { printf 'error: %s exists\n' "$out" >&2; return 1; } + if ! hurl "$url" > "$out"; then + rm "$out" + else + printf '%s\n' "$out" + fi +done diff --git a/.local/bin/ncplot b/.local/bin/ncplot @@ -0,0 +1,2 @@ +#!/bin/sh +ncdump -l 100000 -v "$1" "$2" | ncdump2tsv | gnuplotmatrix diff --git a/.local/bin/ncshow b/.local/bin/ncshow @@ -0,0 +1,2 @@ +#!/bin/sh +ncplot "$1" "$2" | zathura - diff --git a/.profile b/.profile @@ -117,37 +117,6 @@ alias date-alaska='TZ=US/Alaska date' alias date-uk='TZ=Europe/London date' alias date-israel='TZ=Israel date' -gnuplotmatrix() { - gnuplot -e 'set terminal pdf; - set xrange [*:*] noextend; - set yrange [*:*] noextend; - set size ratio -1; - plot "-" matrix w image' -} -ncplot() { - ncdump -l 100000 -v "$1" "$2" | ncdump2tsv | gnuplotmatrix -} -ncshow() { - ncplot "$1" "$2" | zathura - -} - -hurlo() { - if [ "$#" -lt 1 ]; then - cat - else - printf '%s\n' "$@" - fi | while read -r url; do - out="${url##*/}" - [ -z "$out" ] && out="hurl_out" - [ -e "$out" ] && { printf 'error: %s exists\n' "$out" >&2; return 1; } - if ! hurl "$url" > "$out"; then - rm "$out" - else - printf '%s\n' "$out" - fi - done -} - alias w3m='w3m -B' alias w3mtor='torsocks w3m -B "$@"' ddg() {