1# /dis/sh script 2# wm defines "menu" and "delmenu" builtins 3load std 4prompt='% ' '' 5fn % {$*} 6autoload=std 7home=/usr/^"{cat /dev/user} 8 9if {! {~ wm ${loaded}}} { 10 echo wmsetup must run under wm >[1=2] 11 raise usage 12} 13 14fn wmrun { 15 args := $* 16 { 17 pctl newpgrp 18 fn wmrun 19 $args 20 } > /chan/wmstdout >[2] /chan/wmstderr & 21} 22 23fn cd { 24 builtin cd $*; 25 rescue 'bad redir' {} { 26 echo cwd `{pwd} > /chan/shctl 27 } >[2] /dev/null 28} 29 30plumber >/chan/wmstdout >[2=1] 31menu Shell {wmrun wm/sh} 32menu Acme {wmrun acme} 33menu Edit {wmrun wm/edit} 34menu Charon {wmrun charon} 35menu Manual {wmrun wm/man} 36menu Files {if {ftest -d $home} {wmrun wm/ftree $home} {wmrun wm/ftree /}} 37menu '' '' 38menu System 'Debugger' {wmrun wm/deb} 39menu System 'Module manager' {wmrun wm/rt} 40menu System 'Task manager' {wmrun wm/task} 41menu System 'Memory monitor' {wmrun wm/memory} 42menu System 'About' {wmrun wm/about} 43menu Misc 'Coffee' {wmrun wm/coffee} 44menu Misc 'Colours' {wmrun wm/colors} 45#menu Misc 'Winctl' {wmrun wm/winctl} 46menu Misc 'Clock' {wmrun wm/date} 47menu Games 'Tetris' {wmrun wm/tetris} 48menu Games 'Bounce' {wmrun wm/bounce} 49#menu Games 'Game client' {wmrun games/gameclient >/dev/null >[2=1]} 50#menu Games 'Game client (local)' {wmrun games/gameclient -l > /dev/null >[2=1]} 51 52if {ftest -f $home/lib/wmsetup} {run $home/lib/wmsetup} {} 53