summarylogtreecommitdiffstats
path: root/touhou-doom
blob: 92322ae1b083f8698a27282292d14edc45512bab (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
#!/bin/bash

if [ -z "$XDG_CONFIG_HOME" ]; then
    XDG_CONFIG_HOME="$HOME/.config"
fi

if  [ ! -f "$XDG_CONFIG_HOME/touhoudoom/gzdoom.ini" ]; then
    if [ ! -d "$XDG_CONFIG_HOME/touhoudoom" ]; then
        mkdir "$XDG_CONFIG_HOME/touhoudoom"
    fi
    cp "/usr/share/games/doom/gzdoom-touhou.ini" "$XDG_CONFIG_HOME/touhoudoom/gzdoom.ini"
fi

for i in {'DOOM2.WAD','TNT.WAD','PLUTONIA.WAD'}
do
    if  [ -f "/usr/share/games/doom/$i" ] || [ -f "/usr/share/doom/$i" ] || [ -f "$XDG_CONFIG_HOME/gzdoom/$i" ] ||  [ -f "$XDG_CONFIG_HOME/touhoudoom/$i" ] ; then
        iwad=$i
        break
    fi
done

if [ -z "$iwad" ] ; then
    iwad="freedoom2.wad"
fi

gzdoom -config "$XDG_CONFIG_HOME/touhoudoom/gzdoom.ini" -iwad $iwad -file touhoudoom.pk3