shithub: purgatorio

ref: 00c219c7d9c2b9f60c2db0e1ba7289b2301209a7
dir: /lib/wmcharon/

View raw version
# /dis/sh script
# wm defines "menu" and "delmenu" builtins
load std
prompt='% ' ''
fn % {$*}
autoload=std
home=/usr/^"{cat /dev/user}

if {! {~ wm ${loaded}}} {
	echo wmsetup must run under wm >[1=2]
	raise usage
}

fn wmrun {
	args := $*
	{
		pctl newpgrp
		fn wmrun
		$args
	} > /chan/wmstdout >[2] /chan/wmstderr &
}

fn cd {
	builtin cd $*; echo cwd `{pwd} > /chan/shctl >[2] /dev/null
}

plumber >[2] /chan/wmstderr >/chan/wmstdout
wmrun $*