Нашел в интернете простенький скрипт для более удобного просмотра демок для q3.
[code lang=bash]
#!/bin/bash
# Quake3 Demo Player v0.1
#
# Author: Trevor Bender
#
# Description: Shell script to play quake3 demos with support for osp & cpma
#
# Usage: demo <osp|cpma|baseq3> demo_file
#
# Initial Revision: Wed Dec 3 13:03:47 EST 2003
# -check command line options for usage
# -disable energe star screen
# -doesnt change current config
#
# 2nd Revision: Thu Dec 4 23:14:29 EST 2003
# -added support for zip & rar files
# -added support for dm_66,dm_67 demo files
# -added config files
#
# TODO: add config file specifications
# -update demo binds file
# -add support for multiple demo files
#
USAGE="Usage: `basename $0` [osp|cpma|baseq3] <demo_file|zip_file|rar_file>"
MOD="osp"
file=
ver="dm_68"
#check command line arguments
if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
echo "$USAGE"
exit 1
fi
# one command line argument: demo file
if [ $# -eq 1 ] ; then
file="$1"
# two command line arguments: mod & demo file
elif [ $# -eq 2 ] ; then
MOD="$1"
file="$2"
fi
# check the mod
case "$MOD" in
osp|cpma|baseq3) ;;
*)
echo "Error: '$MOD' is not a valid quake3 mod"
exit 1
;;
esac
# make sure file exists
if [ ! -e $file ] ; then
echo "Error: cannot find file '$file'"
exit 1
fi
#process the file type
zip=`echo "$file" | grep -c .zip`
rar=`echo "$file" | grep -c .rar`
dm_68=`echo "$file" | grep -c .dm_68`
dm_67=`echo "$file" | grep -c .dm_67`
dm_66=`echo "$file" | grep -c .dm_66`
if [ $zip -eq 1 ] ; then
dm_68=`unzip -l "$file" | grep -c .dm_68`
dm_67=`unzip -l "$file" | grep -c .dm_67`
dm_66=`unzip -l "$file" | grep -c .dm_66`
elif [ $rar -eq 1 ] ; then
dm_68=`unrar l "$file" | grep -c .dm_68`
dm_67=`unrar l "$file" | grep -c .dm_67`
dm_66=`unrar l "$file" | grep -c .dm_66`
fi
# check for demos
if [ $zip -eq 1 ] && [ $dm_68 -lt 1 ] && [ $dm_67 -lt 1 ] && [ $dm_66 -lt 1 ]
then
echo "Error: zip file '$file' contains no demos"
exit 1
elif [ $rar -eq 1 ] && [ $dm_68 -lt 1 ] && [ $dm_67 -lt 1 ] && [ $dm_66 -lt 1 ]
then
echo "Error: rar file '$file' contains no demos"
exit 1
elif [ $zip -eq 0 ] && [ $rar -eq 0 ] && [ $dm_68 -ne 1 ] && [ $dm_67 -ne 1 ] && [ $dm_66 -ne 1 ] ; then
echo "Error: file '$file' is not a valid .dm_68 demo file"
exit 1
fi
#set demo version
if [ $dm_68 -eq 1 ] ; then
ver="dm_68"
elif [ $dm_67 -eq 1 ] ; then
ver="dm_67"
elif [ $dm_66 -eq 1 ] ; then
ver="dm_66"
fi
#create temporary demo file
if [ $zip -eq 1 ] ; then
unzip -p "$file" > ~/.q3a/$MOD/demos/_demo.$ver
elif [ $rar -eq 1 ] ; then
mkdir -p ._q3demo
cd ._q3demo
unrar e ../$file
cp *.$ver ~/.q3a/$MOD/demos/_demo.$ver
cd ..
rm -rf ._q3demo
else
cp $file ~/.q3a/$MOD/demos/_demo.$ver
fi
# disable energy star so monitor doesnt turn off mid-demo
xset -dpms
xset s off
# save current q3config; don't overwrite
cp ~/.q3a/$MOD/q3config.cfg ~/.q3a/$MOD/q3config.cfg.tmp
demo_binds=
demo_cfg=
#if the files exist then exec them
if [ -e ~/.q3a/baseq3/_demo_binds.cfg ] ; then
demo_binds="+exec _demo_binds"
fi
if [ -e ~/.q3a/baseq3/_demo_cfg.cfg ] ; then
demo_cfg="+exec _demo_cfg"
fi
# run quake3
ioquake3.i386 +set fs_game $MOD $demo_cfg $demo_binds +demo _demo.$ver
#clean up
rm ~/.q3a/$MOD/demos/_demo.$ver
cp ~/.q3a/$MOD/q3config.cfg.tmp ~/.q3a/$MOD/q3config.cfg
rm ~/.q3a/$MOD/q3config.cfg.tmp
#re-enable energy star & screensaver
xset +dpms
xset s on
[/code]