-
Notifications
You must be signed in to change notification settings - Fork 3
/
wrapper
78 lines (64 loc) · 2.33 KB
/
wrapper
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# WINE env
export WINEPREFIX=${WINEPREFIX:-"$HOME/.wine-appimage"}
export WINEDEBUG=${WINEDEBUG:-"fixme-all"}
# DXVK env
export DXVK_HUD=${DXVK_HUD:-"0"}
export DXVK_LOG_LEVEL=${DXVK_LOG_LEVEL:-"none"}
export DXVK_STATE_CACHE=${DXVK_STATE_CACHE:-"0"}
export DXVK_CONFIG_FILE=${DXVK_CONFIG_FILE:-"$progHome/dxvk.conf"}
# check gpu vendor
VENDOR=$(glxinfo -B | grep "OpenGL vendor")
if [[ $VENDOR == *"Intel"* ]]; then
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/intel_icd.i686.json:/usr/share/vulkan/icd.d/intel_icd.x86_64.json"
elif [[ $VENDOR == *"NVIDIA"* ]]; then
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json"
elif [[ $VENDOR == *"Radeon"* ]]; then
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json"
fi
if [ ! -d "$WINEPREFIX" ]; then
if [ ! -d "$HOME"/.cache/wine ]; then
mkdir -p "$HOME"/.cache/wine
fi
# Remove old created links
find "$HOME/.cache/wine/" -type l -delete &>/dev/null
if [ ! -f "$HOME"/.cache/wine/wine-mono-*.msi ]; then
ln -s $APPDIR/winedata/wine-mono-*.msi "$HOME"/.cache/wine/
fi
if [ $(ls $APPDIR/winedata/ | grep gecko | head -1 | grep -c "e_g") -eq 1 ]; then
GECKO=$(ls $APPDIR/winedata/ | grep gecko | head -1 | cut -d'-' -f2)
else
GECKO=$(ls $APPDIR/winedata/ | grep gecko | head -1 | cut -d'-' -f3)
fi
for wg in wine-gecko-${GECKO}-x86.msi wine-gecko-${GECKO}-x86_64.msi wine_gecko-${GECKO}-x86.msi wine_gecko-${GECKO}-x86_64.msi ; do
if [[ ! -f "$HOME"/.cache/wine/$wg && -f $APPDIR/winedata/$wg ]]; then
ln -s $APPDIR/winedata/$wg "$HOME"/.cache/wine/
fi
done
fi
# Load winecfg if no arguments given
APPLICATION=""
if [ -z "$*" ] ; then
APPLICATION="winecfg"
fi
# Allow the AppImage to be symlinked to e.g., /usr/bin/wineserver
if [ -n "$APPIMAGE" ] ; then
BINARY_NAME=$(basename "$ARGV0")
else
BINARY_NAME=$(basename "$0")
fi
if [ -n "$1" ] && [ -e "$APPDIR/bin/$1" ] ; then
MAIN="$APPDIR/bin/$1" ; shift
elif [ -n "$1" ] && [ -e "$APPDIR/usr/bin/$1" ] ; then
MAIN="$APPDIR/usr/bin/$1" ; shift
elif [ -e "$APPDIR/bin/$BINARY_NAME" ] ; then
MAIN="$APPDIR/bin/$BINARY_NAME"
elif [ -e "$APPDIR/usr/bin/$BINARY_NAME" ] ; then
MAIN="$APPDIR/usr/bin/$BINARY_NAME"
else
MAIN="$APPDIR/opt/wine-stable/bin/wine"
fi
if [ -z "$APPLICATION" ] ; then
"$MAIN" "$@" | cat
else
"$MAIN" "$APPLICATION" | cat
fi