summarylogtreecommitdiffstats
path: root/evelauncher.shlib
blob: 54c3d4062b7eb0dcf9ef38b59a8af815169cffba (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
27
28
#!/bin/sh

# Evelauncher shared functions

desktop_msg() {
    if [ -x "$(which notify-send 2>/dev/null)" ] ;then
	notify-send -i eve 'EVE Online Launcher' "$@"
    fi
    echo "$(basename $0): $@"
}

check_custom_wine() {
    EVECONF=$HOME/.config/CCP/EVE.conf
    UCW=$(grep UseCustomWine $EVECONF | cut -d= -f2)
    if [ "x$UCW" = "xtrue" ] ;then
	CUSTOMWP=$(grep CustomWinePath $EVECONF | cut -d= -f2)
	WINEPATH=${CUSTOMWP%/*}
	SHAREDIR=$(grep SharedCacheFolder $EVECONF | cut -d= -f2)
	WINEPREFIX=${SHAREDIR}wineenv
    else
	desktop_msg "ERROR: \"Use custom Wine\" not set!"
	exit 1
    fi
    if [ ! -x "$WINEPATH/wine" ] ;then
	desktop_msg "ERROR: \"$CUSTOMWP\" from \"Custom Wine path\" not found!"
	exit 1
    fi
}