最後活躍 1 month ago

A script to apply ReShade community shaders to Square Enix's FFXIV game

reshade-ffxiv.sh 原始檔案
1#!/bin/bash
2set -euo pipefail
3
4
5if [[ "${*}" == *--steam* ]]; then
6 steamDir="${HOME}/.var/app/com.valvesoftware.Steam"
7 xivlauncherDir="${steamDir}/.xlcore"
8 ffxivDir="${steamDir}/.local/share/Steam/steamapps/common/FINAL FANTASY XIV Online"
9else
10 xivlauncherDir="${HOME}/.xlcore"
11 ffxivDir="${xivlauncherDir}/ffxiv"
12fi
13
14
15if [[ "${*}" == *--steam* ]]; then
16 export MAIN_PATH="${steamDir}/.local/share/reshade"
17fi
18
19export RESHADE_ADDON_SUPPORT=1
20
21printf \
22 '\nDownloading reshade-linux.sh...\n'
23
24curl \
25 -#LOC- \
26 --output-dir '/tmp' \
27 'https://github.com/kevinlekiller/reshade-steam-proton/raw/main/reshade-linux.sh'
28
29printf \
30 '\nDownloading gposingway.zip...\n'
31
32curl \
33 -#LOC- \
34 --output-dir '/tmp' \
35 'https://github.com/gposingway/gposingway/releases/latest/download/gposingway.zip'
36
37printf \
38 '\nDownloading d3dx9.tar.xz...\n'
39
40curl \
41 -#LOC- \
42 --output-dir '/tmp' \
43 'https://proxy.usebottles.com/redistributable/dependencies/d3dx9.tar.xz'
44
45printf \
46 "\nFFXIV game path:\n${ffxivDir}/game\n\nPress [Enter] to continue\n\n"
47
48read -r
49
50bash \
51 '/tmp/reshade-linux.sh'
52
53if [[ -e "${ffxivDir}/game/ReShade.ini" ]] && [[ ! -e "${ffxivDir}/game/ReShade.ini.bak" ]]; then
54 mv \
55 "${ffxivDir}/game/ReShade.ini" \
56 "${ffxivDir}/game/ReShade.ini.bak"
57
58 printf \
59 '\nRenamed ReShade.ini to ReShade.ini.bak\n'
60fi
61
62printf '\nExtracting gposingway.zip...\n'
63
647z \
65 x \
66 -aos \
67 -o"${ffxivDir}/game" \
68 '/tmp/gposingway.zip' \
69 &> /dev/null
70
71if [[ -e "${xivlauncherDir}/wineprefix/drive_c/windows/system32/d3dcompiler_47.dll" ]] && [[ ! -e "${xivlauncherDir}/wineprefix/drive_c/windows/system32/d3dcompiler_47.dll.bak" ]]; then
72 mv \
73 "${xivlauncherDir}/wineprefix/drive_c/windows/system32/d3dcompiler_47.dll" \
74 "${xivlauncherDir}/wineprefix/drive_c/windows/system32/d3dcompiler_47.dll.bak"
75
76 printf \
77 '\nRenamed d3dcompiler_47.dll to d3dcompiler_47.dll.bak\n'
78
79 tar \
80 --directory "${xivlauncherDir}/wineprefix/drive_c/windows/system32/" \
81 --extract \
82 --skip-old-files \
83 --strip-components 2 \
84 --file '/tmp/d3dx9.tar.xz' \
85 'd3dx9/win32/d3dcompiler_47.dll'
86
87 printf \
88 '\nExtracted d3dcompiler_47.dll\n'
89fi
90
91rm \
92 '/tmp/reshade-linux.sh'
93
94rm \
95 '/tmp/gposingway.zip'
96
97rm \
98 '/tmp/d3dx9.tar.xz'
99
100printf '\nReShade & GPosingWay have been installed\n\n'