shithub: rc

ref: 1cf04fdaabf1dbfb7fb4ce59a8cd41a2336d8f18
dir: /bin/qk2/

View raw version
#!/bin/rc
rfork ne
switch($sysname){
	case w520 w520w
		res=(-dx 984 -dy 766)
	case *
		res=(-dx 808 -dy 608)
}
noresz=()
c=(games/quake2)
# launch ctf with: qk2 -g ctf $* +set ctf 1
# launch crbot with: qk2 -g crbot $* +set deathmatch 1 +set ctf 0
while(~ $1 -?){
	switch($1){
	case -g
		# mods' executables are named q2$x
		c=(games/q2$2 +set game $2)
		shift
	case -m
		cdmnt=$2
		shift
	case -r
		res=(-dx `{echo $2 + 8 | pc} -dy `{echo $3 + 8 | pc})
		shift 2
	case -z
		noresz=1
	}
	shift
}
if(~ $#noresz 0)
	echo resize $res >/dev/wctl
bind -q /sys/games/lib/quake2/cd /mnt/cd	# cdfs(4)
$c $*