2 /* $XFree86: xc/programs/xinit/startx.cmd,v 3.3 1996/10/17 15:23:47 dawes Exp $
4 * This is just a sample implementation of a slightly less primitive
5 * interface than xinit. It looks for user xinitrc.cmd and xservrc.cmd
6 * files, then system xinitrc.cmd and xservrc.cmd files, else lets xinit choose
7 * its default. The system xinitrc should probably do things like check
8 * for Xresources files and merge them in, startup up a window manager,
9 * and pop a clock and serveral xterms.
11 * Site administrators are STRONGLY urged to write nicer versions.
15 env = 'OS2ENVIRONMENT'
16 x11root = VALUE('X11ROOT',,env)
17 IF x11root = '' THEN DO
18 SAY "The environment variable X11ROOT is not set. X/OS2 won't run without it."
22 home = VALUE('HOME',,env)
23 IF home = '' THEN home = x11root
24 os_shell = VALUE('X11SHELL',,env)
25 IF os_shell = '' THEN os_shell = VALUE('SHELL',,env)
26 IF os_shell = '' THEN os_shell = VALUE('OS2_SHELL',,env)
27 IF os_shell = '' THEN DO
28 SAY "There is no command interpreter in OS2_SHELL ???"
32 userclientrc = home'\xinitrc.cmd'
33 userserverrc = home'\xservrc.cmd'
34 sysclientrc = x11root'\usr\X11R6\lib\X11\xinit\xinitrc.cmd'
35 sysserverrc = x11root'\usr\X11R6\lib\X11\xinit\xservrc.cmd'
39 IF exists(userclientrc) THEN
40 clientargs = userclientrc
42 IF exists(sysclientrc) THEN
43 clientargs = sysclientrc
45 IF exists(userserverrc) THEN
46 serverargs = userserverrc
48 IF exists(sysserverrc) THEN
49 serverargs = sysserverrc
56 IF \(FILESPEC('DRIVE',cur) = '') THEN DO
57 IF whoseargs = "client" THEN
66 IF whoseargs = "client" THEN
67 clientargs = clientargs' 'cur
69 serverargs = serverargs' 'cur
72 xinit = x11root'\usr\X11R6\bin\xinit'
73 xinit os_shell' /c 'clientargs' -- 'serverargs
78 IF STREAM(arg(1), 'C', 'QUERY EXISTS') = '' THEN