aboutsummaryrefslogtreecommitdiff
path: root/lib/awmsetup
blob: b2821809d4365ca58351eb06181e2dfbe4811027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# /dis/sh script
# wm defines "menu" and "delmenu" builtins
load std
prompt='% ' ''
fn % {$*}
autoload=std
home=/usr/^"{cat /dev/user}


bind -b '#A' /dev
bind '#G' /gui


if {! {~ awm ${loaded}}} {
	echo awmsetup must run under awm >[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 Keyboard			{wmrun wm/keyboard}
menu Shell			{wmrun wm/sh}
#menu Acme			{wmrun acme}
menu Edit				{wmrun wm/edit}
menu Charon			{wmrun charon}
menu Manual			{wmrun wm/man}
menu Files			{if {ftest -d $home} {wmrun wm/ftree $home} {wmrun wm/ftree /}}
menu ''	''
menu System			'Debugger'		{wmrun wm/deb}
menu System			'Module manager'	{wmrun wm/rt}
menu System			'Task manager'		{wmrun wm/task}
menu System			'Memory monitor'	{wmrun wm/memory}
menu System			'About'			{wmrun wm/about}
menu Misc			'Coffee'			{wmrun wm/coffee}
menu Misc			'Colours'			{wmrun wm/colors}
#menu Misc			'Winctl'			{wmrun wm/winctl}
menu Misc			'Clock'			{wmrun wm/date}
menu Games			'Tetris'			{wmrun wm/tetris}
menu Games			'Bounce'			{wmrun wm/bounce}
#menu Games			'Game client'		{wmrun games/gameclient >/dev/null >[2=1]}
#menu Games			'Game client (local)'	{wmrun games/gameclient -l > /dev/null >[2=1]}

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