-
Notifications
You must be signed in to change notification settings - Fork 64
/
TkgThingy
executable file
·211 lines (192 loc) · 6.89 KB
/
TkgThingy
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/bin/bash
## This script can create external configuration files for all -tkg packages and tools supporting the feature.
# Path to create the external config files in - Default is ~/.config/frogminer
_EXT_CONFIG_PATH=~/.config/frogminer
_cfg_loop() {
if [ -e "$_config_file_path"/"$_config_file_basename" ] && [ ! -e "$_EXT_CONFIG_PATH"/"$_config_file_targname" ]; then
cp -v "$_config_file_path"/"$_config_file_basename" "$_EXT_CONFIG_PATH"/"$_config_file_targname"
else
echo "$_EXT_CONFIG_PATH/$_config_file_targname already exists. Skipping..."
fi
}
_external_cfg() {
# dxvk-tools
if [ "$dxvk_tools" == "true" ]; then
_config_file_path=dxvk-tools
_config_file_basename=updxvk.cfg
_config_file_targname=updxvk.cfg
unset dxvk_tools
_cfg_loop
fi
# gamescope
if [ "$gamescope" == "true" ]; then
_config_file_path=gamescope-git
_config_file_basename=customization.cfg
_config_file_targname=gamescope-git.cfg
unset gamescope
_cfg_loop
fi
# linux-tkg
if [ "$linux_tkg" == "true" ]; then
_config_file_path=linux-tkg
_config_file_basename=customization.cfg
_config_file_targname=linux-tkg.cfg
unset linux_tkg
_cfg_loop
fi
# mesa-git
if [ "$mesa_git" == "true" ]; then
_config_file_path=mesa-git
_config_file_basename=customization.cfg
_config_file_targname=mesa-git.cfg
unset mesa_git
_cfg_loop
fi
# mostlyportable-gcc
if [ "$mostlyportable_gcc" == "true" ]; then
_config_file_path=mostlyportable-gcc
_config_file_basename=mostlyportable-gcc.cfg
_config_file_targname=mostlyportable-gcc.cfg
unset mostlyportable_gcc
_cfg_loop
fi
# mostlyportable-mingw
if [ "$mostlyportable_mingw" == "true" ]; then
_config_file_path=mostlyportable-gcc
_config_file_basename=mostlyportable-mingw.cfg
_config_file_targname=mostlyportable-mingw.cfg
unset mostlyportable_mingw
_cfg_loop
fi
# nvidia-all
if [ "$nvidia_all" == "true" ]; then
_config_file_path=nvidia-all
_config_file_basename=customization.cfg
_config_file_targname=nvidia-all.cfg
unset nvidia_all
_cfg_loop
fi
# vkd3d-git
if [ "$vkd3d_git" == "true" ]; then
_config_file_path=vkd3d-git
_config_file_basename=customization.cfg
_config_file_targname=vkd3d-git.cfg
unset vkd3d_git
_cfg_loop
fi
# proton-tkg
if [ "$proton_tkg" == "true" ]; then
_config_file_path=wine-tkg-git/proton-tkg/proton-tkg-profiles
_config_file_basename=sample-external-config.cfg
_config_file_targname=proton-tkg.cfg
unset proton_tkg
_cfg_loop
fi
# wine-tkg
if [ "$wine_tkg" == "true" ]; then
_config_file_path=wine-tkg-git/wine-tkg-git/wine-tkg-profiles
_config_file_basename=sample-external-config.cfg
_config_file_targname=wine-tkg.cfg
unset wine_tkg
_cfg_loop
fi
}
_main_loop() {
echo -e "What do you want to do?"
read -rp "`echo $' > 1.Create missing external config files\n 2.Update submodules\n 3.Reset & update submodules (for conflict fixing - ! will wipe any change vs remote !)\n 4.Exit\nchoice[1-4?]: '`" _choice;
if [ "$_choice" == "2" ]; then
#git submodule update --remote
for _tkg_tools in */; do
if [ "$_tkg_tools" != ".git" ]; then
( cd "$_tkg_tools" && git config pull.rebase false && git checkout master && git pull origin master )
fi
done
elif [ "$_choice" == "3" ]; then
for _tkg_tools in */; do
if [ "$_tkg_tools" != ".git" ]; then
( cd "$_tkg_tools" && git config pull.rebase false && git clean -d -f . && git reset --hard && git checkout master && git pull origin master )
fi
done
elif [ "$_choice" == "4" ]; then
exit 0
else
mkdir -p "$_EXT_CONFIG_PATH"
echo -e "\nPlease select which tool you want to create external config files for (or all of them with option #1) :"
select tkg_tools in "all" "dxvk_tools" "gamescope" "linux_tkg" "mesa_git" "mostlyportable_gcc" "mostlyportable_mingw" "nvidia_all" "vkd3d_git" "proton_tkg" "wine_tkg"
do
case $tkg_tools in
"all")
dxvk_tools="true"
gamescope="true"
linux_tkg="true"
mesa_git="true"
mostlyportable_gcc="true"
mostlyportable_mingw="true"
nvidia_all="true"
vkd3d_git="true"
proton_tkg="true"
wine_tkg="true"
;;
"dxvk_tools")
dxvk_tools="true"
;;
"gamescope")
gamescope="true"
;;
"linux_tkg")
linux_tkg="true"
;;
"mesa_git")
mesa_git="true"
;;
"mostlyportable_gcc")
mostlyportable_gcc="true"
;;
"mostlyportable_mingw")
mostlyportable_mingw="true"
;;
"nvidia_all")
nvidia_all="true"
;;
"vkd3d_git")
vkd3d_git="true"
;;
"proton_tkg")
proton_tkg="true"
;;
"wine_tkg")
wine_tkg="true"
;;
*)
esac
break
done
echo ""
_external_cfg
echo ""
fi
_main_loop
}
cat << 'EOM'
.---.` `.---.
`/syhhhyso- -osyhhhys/`
.syNMdhNNhss/``.---.``/sshNNhdMNys.
+sdMh.`+MNsssssssssssssssNM+`.hMds+
:syNNdhNNhssssssssssssssshNNhdNNys:
/ssyhhhysssssssssssssssssyhhhyss/
.ossssssssssssssssssssssssssssso.
:sssssssssssssssssssssssssssssssss: TKG tools
/sssssssssssssssssssssssssssssssssss/ Thingy
:sssssssssssssoosssssssoosssssssssssss:
osssssssssssssoosssssssoossssssssssssso
osssssssssssyyyyhhhhhhhyyyyssssssssssso
/yyyyyyhhdmmmmNNNNNNNNNNNmmmmdhhyyyyyy/
smmmNNNNNNNNNNNNNNNNNNNNNNNNNNNNNmmms
/dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNd/
`:sdNNNNNNNNNNNNNNNNNNNNNNNNNds:`
`-+shdNNNNNNNNNNNNNNNdhs+-`
`.-:///////:-.`
EOM
echo -e "This script can create external configuration files for all -tkg packages and tools supporting the feature.\nAlready existing config files will NOT be overwritten, so you'll want to remove any you'd want regenerated.\n\nIt can also update submodules if needed.\n"
echo -e "Current external config path is set to $_EXT_CONFIG_PATH \n"
_main_loop