dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit d4276f70551020b9e1e6074f7391e6e0b015212c
parent f304b93b0fa9305c84ead891fe215852807ed2c7
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun, 11 Sep 2022 06:40:31 -0400

Add new local scripts

Diffstat:
Abin/4cast | 24++++++++++++++++++++++++
Abin/9start | 9+++++++++
Abin/acmestart | 16++++++++++++++++
Abin/dwmstart | 13+++++++++++++
Abin/venv | 42++++++++++++++++++++++++++++++++++++++++++
Alib/acme-huge.start | 13+++++++++++++
Alib/acme-large.start | 12++++++++++++
Alib/acme.start | 11+++++++++++
8 files changed, 140 insertions(+), 0 deletions(-)

diff --git a/bin/4cast b/bin/4cast @@ -0,0 +1,24 @@ +#!/usr/lib/plan9/bin/rc +switch (`{uname -o}) { +case Linux + wget=(wget -qO -) +case OpenBSD + wget=(ftp -Vo -) +} + +if (~ $1 -c) { + stat=KORL + $wget 'https://w1.weather.gov/data/obhistory/'$stat.html | 9 htmlfmt | \ + 9 awk '{ if (NR==44 || NR==49 || NR==51) print }' | tr '\n' ' ' | \ + 9 awk '{print "conditions as of", $1, "\n\ttemp: ", $2, "\n\thumidity: ", $3}' +} +if not { + lat=28.5959 + lon=-81.3437 + $wget 'https://forecast.weather.gov/MapClick.php?lat='$lat'&lon='$lon'&unit=0&lg=english&FcstType=text&TextType=1' | 9 htmlfmt | 9 awk ' + /^[A-Za-z ]+:/ { + printf "\n", $0 + } { + print $0 + }' +} diff --git a/bin/9start b/bin/9start @@ -0,0 +1,9 @@ +#!/bin/sh +rm -rf "$NAMESPACE"; mkdir "$NAMESPACE" +pkill plumber +pkill factotum + +9 plumber +9 factotum -n +printf 'secstore ' +aescbc -d <"$HOME/lib/secstore.aes" | 9p write -l factotum/ctl diff --git a/bin/acmestart b/bin/acmestart @@ -0,0 +1,16 @@ +#!/usr/lib/plan9/bin/rc -l +PATH=$HOME/lib/acme:$PATH +SHELL=/usr/lib/plan9/bin/rc +acmeshell=/usr/lib/plan9/bin/rc + +if (test -f $home/tmp/autorandr) { + autorandr=`{cat $home/tmp/autorandr} + switch `{cat $home/tmp/autorandr} { + case desk + extra=(-l $home/lib/acme-huge.start) + case laptop + extra=(-l $home/lib/acme.start) + } +} + +exec $PLAN9/bin/acme -f $font -F /mnt/font/Inconsolata-Regular/11a/font $extra $* diff --git a/bin/dwmstart b/bin/dwmstart @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ -z "$DISPLAY" ] +then + echo $(basename $0): no X session running + exit 1 +fi + +acmestart & +firefox & +slstatus & + +exec dwm diff --git a/bin/venv b/bin/venv @@ -0,0 +1,41 @@ +#!/bin/sh + +help() { + echo "usage: $(basename $0) init | run cmd [arg...]" +} + +init() { + python3 -m venv .venv + . ./.venv/bin/activate + pip install --upgrade pip pip-tools + find .venv -name cacert.perm -exec ln -sf /etc/ssl/cert.pem '{}' \; +} + +run() { + p=$(pwd) + + if [ ! -d .venv ] + then + echo no .venv found in $p + exit 1 + fi + + . ./.venv/bin/activate + + if [ -r .env ] + then + echo sourcing $p/.env >&2 + . ./.env + fi + + "$@" +} + +case $1 in +run) shift && run "$@" ;; +init) init ;; +*) + help + exit 1 + ;; +esac +\ No newline at end of file diff --git a/lib/acme-huge.start b/lib/acme-huge.start @@ -0,0 +1,13 @@ +/home/djmoch +/mnt/font/DejaVuSans/10a/font +/mnt/font/Inconsolata-Regular/10a/font + 0.0000000 25.0099246 50.0198491 74.9900754 +w Newcol Kill Putall Dump Exit +c 0 New Cut Paste Snarf Sort Zerox Delcol +c 1 New Cut Paste Snarf Sort Zerox Delcol +c 2 New Cut Paste Snarf Sort Zerox Delcol +c 3 New Cut Paste Snarf Sort Zerox Delcol +f 0 8 0 0 1.0814708 + 8 36 93 0 0 /home/djmoch/.plan Del Snarf | Look +f 3 6 263 287 1.0814708 + 6 35 287 1 1 /home/djmoch/ Del Snarf Get | Look diff --git a/lib/acme-large.start b/lib/acme-large.start @@ -0,0 +1,12 @@ +/home/djmoch +/mnt/font/DejaVuSans/10a/font +/mnt/font/Inconsolata-Regular/10a/font + 0.0000000 31.3694268 65.8174098 +w Newcol Kill Putall Dump Exit +c 0 New Cut Paste Snarf Sort Zerox Delcol +c 1 New Cut Paste Snarf Sort Zerox Delcol +c 2 New Cut Paste Snarf Sort Zerox Delcol +f 0 4 0 0 1.4548982 /usr/local/plan9/font/fixed/unicode.7x13B.font + 4 36 14 0 0 /home/djmoch/.plan Del Snarf | Look +f 2 5 390 415 1.4548982 + 5 35 415 1 1 /home/djmoch/ Del Snarf Get | Look diff --git a/lib/acme.start b/lib/acme.start @@ -0,0 +1,11 @@ +/home/djmoch +/mnt/font/DejaVuSans/10a/font +/mnt/font/Inconsolata-Regular/10a/font + 0.0000000 60.0232423 +w Newcol Kill Putall Dump Exit +c 0 New Cut Paste Snarf Sort Zerox Delcol +c 1 New Cut Paste Snarf Sort Zerox Delcol +f 0 7 0 0 1.6357688 + 7 41 93 0 0 /home/djmoch/.plan Del Snarf | Look Font +f 1 8 314 333 1.6357688 + 8 35 333 1 1 /home/djmoch/ Del Snarf Get | Look