shithub: 9front-config

Download patch

ref: 908cf58516331f7334225ecbc81e8eb2c0fa0c04
parent: 68f7c9be66955e2a113f29af61de4542b6c0a9d1
author: Romi Hervier <[email protected]>
date: Thu Dec 21 14:25:47 EST 2023

start (not so) fresh

diff: cannot open b/bin/acme//null: file does not exist: 'b/bin/acme//null' diff: cannot open b/bin/git//null: file does not exist: 'b/bin/git//null' diff: cannot open b/bin//null: file does not exist: 'b/bin//null' diff: cannot open b/cfg/beep//null: file does not exist: 'b/cfg/beep//null' diff: cannot open b/cfg/toothless//null: file does not exist: 'b/cfg/toothless//null' diff: cannot open b/cfg//null: file does not exist: 'b/cfg//null' diff: cannot open b/git//null: file does not exist: 'b/git//null' diff: cannot open b/patches//null: file does not exist: 'b/patches//null' diff: cannot open b/themes/rio//null: file does not exist: 'b/themes/rio//null' diff: cannot open b/themes//null: file does not exist: 'b/themes//null'
--- /dev/null
+++ b/README.md
@@ -1,0 +1,4 @@
+# 9front-config
+
+My 9front configs, scripts, and patches. Run `mk` to get started and
+reboot. Third party tools can be fetched with the fetch script.
--- /dev/null
+++ b/bin/acme/Move
@@ -1,0 +1,33 @@
+#!/bin/rc
+rfork n
+if(! ~ `{pwd} /mail/fs/*){
+ echo Must run in mail directory >[1=2]
+ exit 'bad dir'
+}
+# -- tgt...IMAP mail box name
+tgt=$*
+if(~ $#tgt 0){
+ echo No target folder specified >[1=2]
+ exit usage
+}
+# -- src...extract upas mail box name from tag
+# 's/^\/([^ ]+).*$/\1/' … get path excl. initial '/'
+# 's/\/$//' … drop final '/'
+# 's/[^\/]+\///g' … drop everything before last '/'
+# '1q' … stop processing after 1 line
+src=`{sed 's/^\/([^ ]+).*$/\1/
+s/\/$//
+s/[^\/]+\///g
+1q' /mnt/acme/$winid/tag}
+if(! ~ $#src 1){
+ echo Could not determine source folder >[1=2]
+ exit usage
+}
+# -- msgs...extract message numbers from selection in window
+msgs=`{ssam 'x/.*\n/ s/^([0-9]*).*\n/\1 /' /mnt/acme/$winid/rdsel}
+if(~ $#msgs 0){
+ echo No messages selected >[1=2]
+ exit usage
+}
+# -- move $msgs from $src to $tgt
+echo move $src $msgs $tgt > /mail/fs/ctl
--- /dev/null
+++ b/bin/acmenail
@@ -1,0 +1,4 @@
+#!/bin/rc
+
+ptrap edit '.*' +action '^shodata' +filename '^/mail'
+acme -f $sans -F $monospace -l /tmp/acme.dump
--- /dev/null
+++ b/bin/cclock
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+window 0,732,182,1080 games/catclock -c
--- /dev/null
+++ b/bin/clear
@@ -1,0 +1,10 @@
+#!/bin/rc
+# clears all the output from programs,
+# leaving only the command prompts
+
+grep `{echo -n '^'^$prompt(1)} </dev/text | \
+	grep -v '^'^$prompt(1)^'(clear|"")' | \
+	uniq >/tmp/clearing.$pid
+
+cp /tmp/clearing.$pid /dev/text
+rm -f /tmp/clearing.$pid
--- /dev/null
+++ b/bin/facesstart
@@ -1,0 +1,6 @@
+#!/bin/rc
+
+m=/mail/fs
+window 0,404,182,736 faces -c -m $m/Inbox -m $m/9 \
+	-m $m/OpenBSD -m $m/Miscs-Lists -m $m/sr.ht-discuss \
+	-m $m/Feed -m $m/Lobsters
--- /dev/null
+++ b/bin/fml
@@ -1,0 +1,13 @@
+#!/bin/rc
+# Create the mail header that contains the from field
+# A lazy way to handle aliases on Fastmail
+
+header=/mail/box/$user/headers
+switch($1) {
+case r  # My day-to-day email address ;)
+	echo 'From: romi <[email protected]>' > $header
+case rh # My dev email address :^)
+	echo 'From: Romi Hervier <[email protected]>' > $header
+case *
+	echo No.
+}
--- /dev/null
+++ b/bin/git/cia
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+git/commit -e $*
--- /dev/null
+++ b/bin/git/st
@@ -1,0 +1,5 @@
+#!/bin/rc -e
+
+gitroot=`{git/conf -r}
+cd $gitroot && git/fs
+git/walk -f M -f A -f R $*
--- /dev/null
+++ b/bin/grid
@@ -1,0 +1,32 @@
+#!/bin/rc
+
+srv tcp!registry.9p.zone!6675 registry /n/registry
+srv -c tcp!9p.zone!9991 9p.zone.disk /n/disk
+
+fn clean {
+	echo $1 | sed 's/.*!([^!]+)!.*/\1/'
+}
+
+for(s in /n/registry/tcp*){
+	s=`{basename $s}
+	srv $s `{clean $s} /n/^`{clean $s}
+}
+
+>/tmp/chatcat cat <<'...'
+#!/bin/rc
+chan=$1
+label $chan
+cat /n/chat.9p.zone/$chan &
+while() cat | sed '1s/^/'$nick' → /' >>/n/chat.9p.zone/$chan
+...
+chmod +x /tmp/chatcat
+
+>/tmp/gridrio cat <<'...'
+#!/bin/rc
+window -scroll  -r 0 0 9999 9999 /tmp/chatcat chat
+...
+chmod +x /tmp/gridrio
+
+nick=$user
+
+exec rio -s -i /tmp/gridrio
--- /dev/null
+++ b/bin/hombre
@@ -1,0 +1,12 @@
+#!/bin/rc
+ppi=157
+
+if(~ $#* 0){
+	echo 'Usage: hombre x manpage'
+	exit
+}
+if(~ $#* 2)
+	d=$1' '$2
+if not
+	d=$1
+window 'man -t '$d' | page -p '$ppi' -R'
--- /dev/null
+++ b/bin/md
@@ -1,0 +1,21 @@
+#!/bin/rc
+ppi=157
+
+if(test -e /bin/netsurf)
+	browser=netsurf
+if not
+	browser='mothra -a'
+
+if(! test -e /bin/markdown){
+	echo 'You need discount (see 9front’s extras)'
+	exit
+}
+
+if(~ $#* 0){
+	echo 'Usage: md [file]'
+	exit
+}
+d=$1
+f=`{basename $d}
+c='<meta charset="utf-8" />' # netsurf needs this
+window -r 50 50 800 800 -cd `{pwd} 'ramfs;echo '''$c''' > /tmp/'$f'.html; markdown -f 1.0 '$d' >> /tmp/'$f'.html; '$browser' file:///tmp/'$f'.html'
--- /dev/null
+++ b/bin/mush
@@ -1,0 +1,14 @@
+#!/bin/rc
+# rcpu to my servers.
+rfork e
+
+dest=$1.$domain
+
+if(~ $#* 0){
+	echo Usage: mush server [commands…]
+	exit
+}
+if not if (~ $#2 0)
+	rcpu -h $dest
+if not if (~ $#2 1)
+	rcpu -h $dest -u -c $2
--- /dev/null
+++ b/bin/nailstart
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+window 182,0,1920,1080 acmenail
--- /dev/null
+++ b/bin/pdf
@@ -1,0 +1,16 @@
+#!/bin/rc
+ppi=157
+
+if(~ $#* 0){
+	echo 'Usage: pdf [file] [page]'
+	exit
+}
+
+d=$1
+
+if(~ $#2 1){
+	p=$2
+	window -cd `{pwd} page -R -p $ppi -j $d!$p $d
+}
+if not
+	window -cd `{pwd} page -R -p $ppi $d
--- /dev/null
+++ b/bin/riostart
@@ -1,0 +1,6 @@
+#!/bin/rc
+
+window -hide -scroll cat /dev/kprint
+window -scroll
+~ $console 0 || window -scroll -hide console
+window theme
--- /dev/null
+++ b/bin/rircx
@@ -1,0 +1,5 @@
+#!/bin/rc
+rfork
+rimport asinru.sansfontieres.com /srv
+rimport asinru.sansfontieres.com  /tmp
+ircx -s libera $*
--- /dev/null
+++ b/bin/roi
@@ -1,0 +1,7 @@
+#!/bin/rc
+
+facesstart
+statsstart
+nailstart
+cclock
+window riow
--- /dev/null
+++ b/bin/s
@@ -1,0 +1,7 @@
+#!/bin/rc
+# My base sam config.
+rfork
+font=$monospace
+
+bind /bin/aux/samterm.$sysname /bin/aux/samterm
+sam -a $*
--- /dev/null
+++ b/bin/sd
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+sam -d $*
--- /dev/null
+++ b/bin/solo
@@ -1,0 +1,6 @@
+#!/bin/rc
+# Sam but you can’t plumb it.
+rfork n
+
+unmount /mnt/plumb
+s $*
--- /dev/null
+++ b/bin/sp
@@ -1,0 +1,8 @@
+#!/bin/rc
+# Sam but it spawns a ptrapped window for the current and child
+# directories.
+
+
+pth=`{pwd}
+
+window -cd $pth 'ptrap edit ''^'$pth/'''; s'
--- /dev/null
+++ b/bin/statsstart
@@ -1,0 +1,5 @@
+#!/bin/rc
+font=$monospace
+opts=-l8zmfe
+window 0,0,182,204 stats $opts $sysname 
+window 0,200,182,408 stats $opts beep.$domain
--- /dev/null
+++ b/bin/theme
@@ -1,0 +1,4 @@
+#!/bin/rc
+
+cat $home/lib/themes/rio/$sysname > /mnt/wsys/theme
+grep softscreen /dev/vgactl >> /dev/vgactl
--- /dev/null
+++ b/bin/todostart
@@ -1,0 +1,4 @@
+#!/bin/rc
+
+facesgreet='※ Buffered Tasks'
+window 0,306,400,408 faces -c -im /mail/fs/Later
--- /dev/null
+++ b/bin/topwin
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+window 400,0,1920,265 $*
--- /dev/null
+++ b/bin/zuke
@@ -1,0 +1,5 @@
+#!/bin/rc
+theme=$zuketheme
+font=$sansserif
+
+audio/mkplist /n/music | audio/zuke -c aAt
--- /dev/null
+++ b/cfg/beep/cpustart
@@ -1,0 +1,4 @@
+#!/bin/rc
+
+auth/secstored
+auth/secstore -n -G factotum >> /mnt/factotum/ctl
--- /dev/null
+++ b/cfg/toothless/termrc
@@ -1,0 +1,6 @@
+#!/bin/rc
+
+TIMESYNCARGS=(-n pool.ntp.org)
+
+aux/acpi
+ip/ipconfig loopback /dev/null 127.0.0.1
--- /dev/null
+++ b/fetch
@@ -1,0 +1,22 @@
+#!/bin/rc
+
+mkdir -p $home/src
+cd $home/src
+repositories=(\
+gits://shithub.us/ori/Nail         \
+gits://shithub.us/kvik/clone       \
+gits://shithub.us/sigrid/riow      \
+gits://shithub.us/sigrid/bar       \
+gits://shithub.us/sigrid/femtolisp \
+https://github.com/netsurf-plan9/nsport)
+
+for(i in $repositories) {
+	switch($1) {
+	case update
+		 cd `{basename $i}; git/pull; cd ..;
+	case clone
+		git/clone $i
+	case *
+		echo what; exit
+	}
+}
--- /dev/null
+++ b/git/config
@@ -1,0 +1,3 @@
+[user]
+	name = Romi Hervier
+	email = [email protected]
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,42 @@
+</$objtype/mkfile
+
+all = $home/lib/profile $home/lib/plumbing $home/lib/git $home/lib/bin /cfg/$sysname $home/lib/themes $objtype/bin/prompt
+
+all:V: $all
+
+clean:V:
+	rm -rf $all
+
+$home/lib/profile: profile
+	cp $prereq $target
+
+$home/lib/plumbing: plumbing
+	cp $prereq $target
+
+$home/lib/git: git
+	rm -rf $target
+	clone $prereq $target
+
+$home/lib/themes: themes
+	rm -rf $target
+	clone $prereq $target
+
+$home/lib/bin: bin
+	rm -f $target/*
+	rm -f $target/git/*
+	rm -f $target/acme/*
+	mkdir -p $target/git
+	mkdir -p $target/acme
+	cp $prereq/git/* $target/git/
+	cp $prereq/acme/* $target/acme/
+	cp $prereq/* $target
+
+/cfg/$sysname: cfg/$sysname
+	rm -rf $target
+	clone $prereq $target
+
+/$objtype/bin/prompt: prompt.$O
+	$LD -o $target $prereq
+
+%.$O: %.c
+	$CC $CFLAGS src/$stem.c
--- /dev/null
+++ b/patches/catclock.diff
@@ -1,0 +1,12 @@
+diff 845f8d12e4e417aaafaa6e62a80bf03856e7d906 uncommitted
+--- a/sys/src/games/catclock.c
++++ b/sys/src/games/catclock.c
+@@ -225,7 +225,7 @@
+ 	if(xredraw || tm.min!=otm.min || tm.hour!=otm.hour){
+ 		if(xredraw){
+ 			draw(screen, screen->r, display->white, nil, ZP);
+-			border(screen, screen->r, 4, display->black, ZP);
++			// border(screen, screen->r, 4, display->black, ZP);
+ 			replclipr(screen, 0, insetrect(screen->r, 4));
+ 			//bitblt(&screen, screen.r.min, &screen, screen.r, Zero);
+ 			//border(&screen, screen.r, 4, F);
--- /dev/null
+++ b/patches/faces_lazy.diff
@@ -1,0 +1,74 @@
+diff 845f8d12e4e417aaafaa6e62a80bf03856e7d906 uncommitted
+--- a/sys/src/cmd/faces/main.c
++++ b/sys/src/cmd/faces/main.c
+@@ -73,7 +73,7 @@
+ ulong	now;
+ 
+ Point	datep = { 8, 6 };
+-Point	facep = { 8, 6+0+4 };	/* 0 updated to datefont->height in init() */
++Point	facep = { 8, 6 };	/* 0 updated to datefont->height in init() */
+ Point	enddate;			/* where date ends on display; used to place arrows */
+ Rectangle	leftr;			/* location of left arrow on display */
+ Rectangle	rightr;		/* location of right arrow on display */
+@@ -98,7 +98,7 @@
+ 	initplumb();
+ 
+ 	/* make background color */
+-	bgrnd = allocimagemix(display, DPalebluegreen, DWhite);
++	bgrnd = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E3FAFF);
+ 	blue = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x008888FF);	/* blue-green */
+ 	left = allocimage(display, leftright, GREY1, 0, DWhite);
+ 	right = allocimage(display, leftright, GREY1, 0, DWhite);
+@@ -119,9 +119,9 @@
+  		mediumfont = font;
+ 	datefont = font;
+ 
+-	facep.y += datefont->height;
++	facep.y += 0;
+ 	if(datefont->height & 1)	/* stipple parity */
+-		facep.y++;
++		facep.y += 0;
+ 	faces = nil;
+ }
+ 
+@@ -351,7 +351,7 @@
+ 	free(ofaces);
+ 	nfaces++;
+ 	setlast();
+-	drawarrows();
++	/* drawarrows(); */
+ 	faces[0] = f;
+ 	drawface(f, 0);
+ 	flushimage(display, 1);
+@@ -430,7 +430,7 @@
+ 	memmove(faces+j, faces+j+1, (nfaces-(j+1))*sizeof(Face*));
+ 	nfaces--;
+ 	setlast();
+-	drawarrows();
++	/* drawarrows(); */
+ }
+ 
+ void
+@@ -493,7 +493,7 @@
+ 	drawtime();
+ 	for(i=0; i<nfaces; i++)
+ 		drawface(faces[i], i);
+-	drawarrows();
++	/* drawarrows(); */
+ 	flushimage(display, 1);
+ }
+ 
+@@ -712,11 +712,11 @@
+ 	init();
+ 	unlockdisplay(display);	/* initdraw leaves it locked */
+ 	display->locking = 1;	/* tell library we're using the display lock */
+-	setdate();
++	/* setdate(); */
+ 	eresized(0);
+ 
+ 	pids[Mainp] = getpid();
+-	startproc(timeproc, Timep);
++	/* startproc(timeproc, Timep); */
+ 	startproc(mouseproc, Mousep);
+ 	if(initload)
+ 		for(i = 0; i < nmaildirs; i++)
--- /dev/null
+++ b/patches/samterm.beep.diff
@@ -1,0 +1,96 @@
+diff -r 175f3e344edd sys/src/cmd/samterm/flayer.c
+--- a/sys/src/cmd/samterm/flayer.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/flayer.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -29,18 +29,22 @@
+ 	lDrect = r;
+ 
+ 	/* Main text is yellowish */
+-	maincols[BACK] = allocimagemix(display, DPaleyellow, DWhite);
+-	maincols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow);
+-	maincols[BORD] = allocimage(display, Rect(0,0,2,2), screen->chan, 1, DYellowgreen);
+-	maincols[TEXT] = display->black;
+-	maincols[HTEXT] = display->black;
++	maincols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF);
++	maincols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xCD664DFF);
++ 	maincols[BORD] = allocimage(display, Rect(0,0,2,2), CMAP8, 1, 0x8795BFFF);
++ 	draw(maincols[BORD], Rect(1,1,2,2), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF), nil, ZP);
++ 	draw(maincols[BORD], Rect(0,0,1,1), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF), nil, ZP);
++	maincols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x4F5165FF);
++	maincols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF);
+ 
+ 	/* Command text is blueish */
+-	cmdcols[BACK] = allocimagemix(display, DPalebluegreen, DWhite);
+-	cmdcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPalegreygreen);
+-	cmdcols[BORD] = allocimage(display, Rect(0,0,2,2), screen->chan, 1, DPurpleblue);
+-	cmdcols[TEXT] = display->black;
+-	cmdcols[HTEXT] = display->black;
++	cmdcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x4F5165FF);
++	cmdcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF);
++	cmdcols[BORD] = allocimage(display, Rect(0,0,2,2), CMAP8, 1, 0x8795BFFF);
++ 	draw(cmdcols[BORD], Rect(1,1,2,2), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF), nil, ZP);
++ 	draw(cmdcols[BORD], Rect(0,0,1,1), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF), nil, ZP);
++	cmdcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E8E8FF);
++	cmdcols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xCD664DFF);
+ }
+ 
+ void
+diff -r 175f3e344edd sys/src/cmd/samterm/menu.c
+--- a/sys/src/cmd/samterm/menu.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/menu.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -45,21 +45,21 @@
+ };
+ 
+ char	*menu2str[] = {
+-	"cut",
+-	"paste",
+-	"snarf",
+-	"plumb",
+-	"look",
++	"Cut",
++	"Paste",
++	"Snarf",
++	"Plumb",
++	"Look",
+ 	"<rio>",
+ 	0,		/* storage for last pattern */
+ };
+ 
+ char	*menu3str[] = {
+-	"new",
+-	"zerox",
+-	"resize",
+-	"close",
+-	"write",
++	"New",
++	"Zerox",
++	"Resize",
++	"Close",
++	"Write",
+ };
+ 
+ Menu	menu2 =	{0, genmenu2};
+diff -r 175f3e344edd sys/src/cmd/samterm/mkfile
+--- a/sys/src/cmd/samterm/mkfile	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/mkfile	Sat Feb 20 13:42:52 2021 +0100
+@@ -1,6 +1,6 @@
+ </$objtype/mkfile
+ 
+-TARG=samterm
++TARG=samterm.$sysname
+ OFILES=main.$O\
+ 	icons.$O\
+ 	menu.$O\
+diff -r 175f3e344edd sys/src/cmd/samterm/scroll.c
+--- a/sys/src/cmd/samterm/scroll.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/scroll.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -93,8 +93,9 @@
+ 	if(!eqrect(r2, l->lastsr)){
+ 		l->lastsr = r2;
+ 		draw(b, r1, l->f.cols[BORD], nil, ZP);
+-		draw(b, r2, l->f.cols[BACK], nil, r2.min);
++		draw(b, r2, allocimage(display, Rect(0,0,2,2), screen->chan, 1, 0x8795BFFF), nil, r2.min);
+ 		r2 = r1;
++		r2.max.x = r2.max.x+1;
+ 		r2.min.x = r2.max.x-1;
+ 		draw(b, r2, l->f.cols[BORD], nil, ZP);
+ 		if(b!=l->f.b)
--- /dev/null
+++ b/patches/samterm.toothless.diff
@@ -1,0 +1,96 @@
+diff -r 175f3e344edd sys/src/cmd/samterm/flayer.c
+--- a/sys/src/cmd/samterm/flayer.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/flayer.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -29,18 +29,22 @@
+ 	lDrect = r;
+ 
+ 	/* Main text is yellowish */
+-	maincols[BACK] = allocimagemix(display, DPaleyellow, DWhite);
+-	maincols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow);
+-	maincols[BORD] = allocimage(display, Rect(0,0,2,2), screen->chan, 1, DYellowgreen);
+-	maincols[TEXT] = display->black;
+-	maincols[HTEXT] = display->black;
++	maincols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xFFFFFFFF);
++	maincols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E3FAFF);
++ 	maincols[BORD] = allocimage(display, Rect(0,0,2,2), CMAP8, 1, 0x858585FF);
++ 	draw(maincols[BORD], Rect(1,1,2,2), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xFFFFFFFF), nil, ZP);
++ 	draw(maincols[BORD], Rect(0,0,1,1), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xFFFFFFFF), nil, ZP);
++	maincols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x222222FF);
++	maincols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x222222FF);
+ 
+ 	/* Command text is blueish */
+-	cmdcols[BACK] = allocimagemix(display, DPalebluegreen, DWhite);
+-	cmdcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPalegreygreen);
+-	cmdcols[BORD] = allocimage(display, Rect(0,0,2,2), screen->chan, 1, DPurpleblue);
+-	cmdcols[TEXT] = display->black;
+-	cmdcols[HTEXT] = display->black;
++	cmdcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xEEEEEEFF);
++	cmdcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xE2E3FAFF);
++	cmdcols[BORD] = allocimage(display, Rect(0,0,2,2), CMAP8, 1, 0x858585FF);
++ 	draw(cmdcols[BORD], Rect(1,1,2,2), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xEEEEEEFF), nil, ZP);
++ 	draw(cmdcols[BORD], Rect(0,0,1,1), allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xEEEEEEFF), nil, ZP);
++	cmdcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x222222FF);
++	cmdcols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x222222FF);
+ }
+ 
+ void
+diff -r 175f3e344edd sys/src/cmd/samterm/menu.c
+--- a/sys/src/cmd/samterm/menu.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/menu.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -45,21 +45,21 @@
+ };
+ 
+ char	*menu2str[] = {
+-	"cut",
+-	"paste",
+-	"snarf",
+-	"plumb",
+-	"look",
++	"Cut",
++	"Paste",
++	"Snarf",
++	"Plumb",
++	"Look",
+ 	"<rio>",
+ 	0,		/* storage for last pattern */
+ };
+ 
+ char	*menu3str[] = {
+-	"new",
+-	"zerox",
+-	"resize",
+-	"close",
+-	"write",
++	"New",
++	"Zerox",
++	"Resize",
++	"Close",
++	"Write",
+ };
+ 
+ Menu	menu2 =	{0, genmenu2};
+diff -r 175f3e344edd sys/src/cmd/samterm/mkfile
+--- a/sys/src/cmd/samterm/mkfile	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/mkfile	Sat Feb 20 13:42:52 2021 +0100
+@@ -1,6 +1,6 @@
+ </$objtype/mkfile
+ 
+-TARG=samterm
++TARG=samterm.$sysname
+ OFILES=main.$O\
+ 	icons.$O\
+ 	menu.$O\
+diff -r 175f3e344edd sys/src/cmd/samterm/scroll.c
+--- a/sys/src/cmd/samterm/scroll.c	Sat Feb 20 12:55:42 2021 +0100
++++ b/sys/src/cmd/samterm/scroll.c	Sat Feb 20 13:42:52 2021 +0100
+@@ -93,8 +93,9 @@
+ 	if(!eqrect(r2, l->lastsr)){
+ 		l->lastsr = r2;
+ 		draw(b, r1, l->f.cols[BORD], nil, ZP);
+-		draw(b, r2, l->f.cols[BACK], nil, r2.min);
++		draw(b, r2, allocimage(display, Rect(0,0,2,2), screen->chan, 1, 0xEEEEEEFF), nil, r2.min);
+ 		r2 = r1;
++		r2.max.x = r2.max.x+1;
+ 		r2.min.x = r2.max.x-1;
+ 		draw(b, r2, l->f.cols[BORD], nil, ZP);
+ 		if(b!=l->f.b)
--- /dev/null
+++ b/plumbing
@@ -1,0 +1,17 @@
+# to update: cp $home/lib/plumbing /mnt/plumb/rules
+
+editor = sam
+browser = netsurf
+
+# Thanks Sigrid
+type	is	text
+data 	matches	'https://(www.)?youtube[^ ]+'
+plumb	start	window yt ''''$0''''
+
+# Thanks Sirjofri
+type	is	text
+data	matches	'9fs://([^ /]+)/([^ ]+/)([^ ]*)'
+plumb	start	window 9fs $1 && cd /n/$1/$2 && ls -l $3 && rc -i
+
+include basic
+
--- /dev/null
+++ b/profile
@@ -1,0 +1,95 @@
+bind -qa $home/bin/rc /bin
+bind -qa $home/bin/$cputype /bin
+bind -qa $home/lib/bin /bin
+bind -qa $home/lib/bin/git /bin/git
+bind -qa $home/lib/bin/acme /acme/bin
+
+fontlib=$home/lib/font/bit
+fontsize=14
+monospace=$fontlib/pragmata/pragmata.$fontsize.font
+fontsize=16
+sans=$fontlib/inter/inter.$fontsize.font
+font=$sans
+tabstop=2
+
+domain=grtsk.com
+
+mailserver=fastmail.com
[email protected]
+maildirs=(Inbox Archive Sent 9 Feed Lobsters Miscs-Lists OpenBSD sr.ht-discuss Todo)
+
+fn open_mailboxes {
+	upas/fs -f /imaps/imap.$mailserver/$mailuser
+	for(i in $maildirs){
+		echo open /imaps/imap.$mailserver/$mailuser/$i $i > /mail/fs/ctl &
+	}
+}
+
+fn load_factotum{
+	ipso -l || load_factotum
+}
+
+fn setup_secstore{ # see /cfg/$sysname/termrc
+	secstore=tcp!127.0.0.1!5356
+	auth/secstored -s $secstore
+	load_factotum
+}
+
+fn wifi{
+	grep node '#l1'/ether1/ifstats
+	echo -n 'essid='
+	essid=`{read}
+	bind -a '#l1' /net
+	aux/wpa -s $essid -p /net/ether1
+	ip/ipconfig ether /net/ether1
+}
+
+switch($service){
+case terminal
+	webcookies
+	webfs
+	setup_secstore
+	wifi
+	plumber
+	open_mailboxes
+	echo -n accelerated > '#m/mousectl'
+	echo -n 'res 3' > '#m/mousectl'
+	prompt=('; ' '	')
+	fn term%{ $* }
+	rio -si riostart
+case cpu
+	bind /mnt/term/dev/cons /dev/cons
+	bind -q /mnt/term/dev/consctl /dev/consctl
+	>[2] /dev/null {
+		cp /dev/sysname /mnt/term/dev/label
+		if(wsys=`{cat /mnt/term/env/wsys} && ~ $#wsys 1) {
+			wsys=/mnt/term^$wsys
+		}
+		if not {
+			wsys=()
+		}
+	} 
+	bind -a /mnt/term/dev /dev
+	prompt=(''$sysname'; ' '	')
+	fn cpu%{ $* }
+	if(! test -e /mnt/term/dev/wsys){
+		# call from drawterm
+		if(test -e /mnt/term/dev/secstore){
+			auth/factotum -n
+			read -m /mnt/term/dev/secstore >/mnt/factotum/ctl
+			echo >/mnt/term/dev/secstore
+		}
+		if not
+			auth/factotum
+		webcookies
+		webfs
+		plumber
+		rio
+	}
+case con
+	prompt=('cpu% ' '	')
+}
+
+# Some aliases
+fn vis{s $*}
+fn sma{s  $*}
--- /dev/null
+++ b/themes/rio/beep
@@ -1,0 +1,20 @@
+rioback	dddddd
+back	e2e8e8
+high	abb7ba
+border	abb7ba
+text	4f5165
+htext	e2e8e8
+title	8795bf
+ltitle	4f5165
+hold	cd664d
+lhold	d49b82
+palehold	d49b82
+paletext	75878f
+size	cd664d
+menubar	846d21
+menuback	e2e8e8
+menuhigh	cd664d
+menubord	cd664d
+menutext	4f5165
+menuhtext	e2e8e8
+
--- /dev/null
+++ b/themes/rio/toothless
@@ -1,0 +1,20 @@
+rioback	eeeeee
+back	ffffff
+high	e2e3fa
+border	858585
+text	222222
+htext	222222
+title	858585
+ltitle	cccccc
+hold	0063db
+lhold	a4adee
+palehold	a4adee
+paletext	858585
+size	d11100
+menubar	846d21
+menuback	ffffff
+menuhigh	ffffff
+menubord	db6600
+menutext	222222
+menuhtext	db6600
+