forked from orsonteodoro/psdoom-ng1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpsd.in
39 lines (36 loc) · 1.6 KB
/
psd.in
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
#!/bin/bash
if [[ ! -f /home/${USER}/.psdoom-ng/psdoom-ng.conf ]]; then
mkdir -p /home/${USER}/.psdoom-ng
cat << EOF > /home/${USER}/.psdoom-ng/psdoom-ng.conf
PSDOOMPSCMD="\${HOME}/.psdoom-ng/ps.sh"
PSDOOMRENICECMD="renice"
PSDOOMKILLCMD="kill -9"
DOOMWADPATH="\${HOME}/.psdoom-ng/psdoom-data"
# doom1e1p1 pid monster start coordinates
#DEFAULT_ARGS="-psuser \${USER} -episode 1 -godstart -telestartf 136310834 -257677815"
DEFAULT_ARGS="-psallusers -episode 1 -godstart"
EOF
fi
if [[ ! -f /home/${USER}/.psdoom-ng/ps.sh ]]; then
cat << EOF > /home/${USER}/.psdoom-ng/ps.sh
#!/bin/bash
### get all processes but ...
### exclude kernel processes "[foobar]" and psd(oom) processes
ps aux|awk '{print \$1,\$2,\$11,"0"}'|grep -E -v '^USER|\[|psd|doom'
EOF
chmod +x /home/${USER}/.psdoom-ng/ps.sh
fi
if [[ -f /home/${USER}/.psdoom-ng/psdoom-ng.conf ]]; then
source /home/${USER}/.psdoom-ng/psdoom-ng.conf
elif [[ -f /etc/psdoom-ng.conf ]]; then
source /etc/psdoom-ng.conf
fi
[[ ! -v PSDOOMPSCMD || -z $PSDOOMPSCMD ]] && Z="$(unset PSDOOMPSCMD)" || export PSDOOMPSCMD="${PSDOOMPSCMD}"
[[ ! -v PSDOOMRENICECMD || -z $PSDOOMRENICECMD ]] && Z="$(unset PSDOOMRENICECMD)" || export PSDOOMRENICECMD="${PSDOOMRENICECMD}"
[[ ! -v PSDOOMKILLCMD || -z $PSDOOMKILLCMD ]] && Z="$(unset PSDOOMKILLCMD)" || export PSDOOMKILLCMD="${PSDOOMKILLCMD}"
[[ ! -v DOOMWADPATH || -z $DOOMWADPATH ]] && Z="$(unset DOOMWADPATH)" || export DOOMWADPATH="${DOOMWADPATH}"
echo "PSDOOMPSCMD=${PSDOOMPSCMD}"
echo "PSDOOMRENICECMD=${PSDOOMRENICECMD}"
echo "PSDOOMKILLCMD=${PSDOOMKILLCMD}"
echo "DOOMWADPATH=${DOOMWADPATH}"
/usr/bin/psdoom-ng ${DEFAULT_ARGS} $@