Plan 9 from Bell Labs’s /usr/web/sources/contrib/rog/infauth/unpacked/lib/wmsetup.new

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


# /dis/sh script
# wm defines "menu" and "delmenu" builtins
load std
prompt='% ' ''
fn % {$*}
home=/usr/^"{cat /dev/user}
bind -b '#^' /chan
winsrv

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 $*;
	rescue 'bad redir' {} {
		echo cwd `{pwd} > /chan/shctl
	} >[2] /dev/null
}

plumber >/chan/wmstdout >[2=1]
menu Shell			{wmrun wm/sh}
menu Snarftmp		{cp /chan/snarf /tmp/snarf.txt}
menu Acme			{wmrun acme}
menu Charon			{wmrun charon}
menu Manual			{wmrun wm/man}
menu Files			{if {ftest -d $home} {wmrun wm/ftree $home} {wmrun wm/ftree /}}
menu ''	''
menu Grid			'Node monitor' {wmrun nodemonitor}
menu Grid			'Job monitor' {wmrun jobmonitor}
menu System			'Debugger'		{wmrun wm/deb}
menu System			'Task manager'		{wmrun wm/task}
menu System			'Memory monitor'	{wmrun wm/memory}
menu System			'About'			{wmrun wm/about}
menu Games			'Tetris'			{wmrun wm/tetris}
menu Games			'Bounce'			{wmrun wm/bounce}

# anything else
if {ftest -f $home/lib/wmsetup} {run $home/lib/wmsetup} {}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.