shithub: ninethings

ref: a98310a4b186bcdc1e2e3b6176249865277e8a3d
dir: /profile/

View raw version
bind -qa $home/bin/rc /bin
bind -qa $home/bin/$cputype /bin

aux/timesync -n pool.ntp.org

upasname='[email protected]'

mouse_opts=(accelerated 'res 3' 'blanktime 5')

go_version=1.21.3
go_path=/sys/lib/go/$objtype-$go_version
if(test -d $go_path){
	GOROOT=$go_path
	bind -b $go_path/bin /bin
}

font=/lib/font/bit/vga/unicode.font
if(test -d /lib/font/bit/Go-Mono){
	truetypefs
	font=/lib/font/bit/Go-Mono/Go-Mono.14.font
}

fn startirc{
	echo scroll >/mnt/wsys/wctl
	ircrc -p 6697 -t '#cat-v' -n ninebit -T irc.oftc.net
}

machine=`{echo $terminal | awk -F/ '{print $5}'}

switch($service){
case terminal
	truetypefs

	if(! ~ $machine 'imx8')
		aux/acpi

	webcookies
	webfs
	plumber

	for(o in $mouse_opts) echo -n $o >'#m/mousectl'
	prompt=('; ' '	')
	fn term%{ $* }
	rio -i 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=/mnt/term^$wsys
	} 
	bind -a /mnt/term/dev /dev
	prompt=('cpu% ' '	')
	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
		truetypefs
		webcookies
		webfs
		plumber
		rio -i riostart
	}
case con
	prompt=('cpu% ' '	')
}