2020-04-15 09:09:55 +07:00
#!/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
2020-04-15 09:33:27 +07:00
echo "$_EXT_CONFIG_PATH/$_config_file_targname already exists. Skipping..."
2020-04-15 09:09:55 +07:00
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
2020-04-16 09:43:10 +07:00
unset dxvk_tools
2020-04-15 09:09:55 +07:00
_cfg_loop
fi
# gamescope
if [ "$gamescope" == "true" ]; then
_config_file_path=gamescope-git
_config_file_basename=customization.cfg
_config_file_targname=gamescope-git.cfg
2020-04-16 09:43:10 +07:00
unset gamescope
2020-04-15 09:09:55 +07:00
_cfg_loop
fi
# linux54-tkg
if [ "$linux54_tkg" == "true" ]; then
_config_file_path=linux-tkg/linux54-tkg
_config_file_basename=customization.cfg
_config_file_targname=linux54-tkg.cfg
2020-04-16 09:43:10 +07:00
unset linux54_tkg
2020-04-15 09:09:55 +07:00
_cfg_loop
fi
2020-06-15 10:29:47 +07:00
# linux57-tkg
if [ "$linux57_tkg" == "true" ]; then
_config_file_path=linux-tkg/linux57-tkg
2020-04-15 09:09:55 +07:00
_config_file_basename=customization.cfg
_config_file_targname=linux57-tkg.cfg
2020-06-15 10:29:47 +07:00
unset linux57_tkg
_cfg_loop
fi
2020-08-19 05:29:28 +07:00
# linux58-tkg
if [ "$linux58_tkg" == "true" ]; then
_config_file_path=linux-tkg/linux58-tkg
2020-06-15 10:29:47 +07:00
_config_file_basename=customization.cfg
_config_file_targname=linux58-tkg.cfg
2020-08-19 05:29:28 +07:00
unset linux58_tkg
_cfg_loop
fi
# linux59_rc-tkg
if [ "$linux59_rc_tkg" == "true" ]; then
_config_file_path=linux-tkg/linux59-rc-tkg
_config_file_basename=customization.cfg
_config_file_targname=linux59-tkg.cfg
unset linux59_rc_tkg
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset mesa_git
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset mostlyportable_gcc
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset mostlyportable_mingw
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset nvidia_all
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset vkd3d_git
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset proton_tkg
2020-04-15 09:09:55 +07:00
_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
2020-04-16 09:43:10 +07:00
unset wine_tkg
2020-04-15 09:09:55 +07:00
_cfg_loop
fi
}
2020-04-16 09:43:10 +07:00
_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.Exit\nchoice[1-3?]: '`" _choice;
if [ "$_choice" == "2" ]; then
2020-07-30 09:21:29 +07:00
#git submodule update --remote
for _tkg_tools in */; do
if [ "$_tkg_tools" != ".git" ]; then
2020-09-03 06:16:36 +07:00
( cd "$_tkg_tools" && git config pull.rebase false && git checkout master && git pull origin master )
2020-07-30 09:21:29 +07:00
fi
done
2020-04-16 09:43:10 +07:00
elif [ "$_choice" == "3" ]; then
exit 0
else
2020-04-19 14:00:22 +07:00
mkdir -p "$_EXT_CONFIG_PATH"
2020-04-16 09:43:10 +07:00
echo -e "\nPlease select which tool you want to create external config files for (or all of them with option #1) :"
2020-08-19 05:29:28 +07:00
select tkg_tools in "all" "dxvk_tools" "gamescope" "linux54_tkg" "linux57_tkg" "linux58_tkg" "linux59_rc_tkg" "mesa_git" "mostlyportable_gcc" "mostlyportable_mingw" "nvidia_all" "vkd3d_git" "proton_tkg" "wine_tkg"
2020-04-16 09:43:10 +07:00
do
case $tkg_tools in
"all")
dxvk_tools="true"
gamescope="true"
linux54_tkg="true"
linux56_tkg="true"
2020-06-15 10:29:47 +07:00
linux57_tkg="true"
linux58_rc_tkg="true"
2020-04-16 09:43:10 +07:00
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"
;;
"linux54_tkg")
linux54_tkg="true"
;;
2020-06-15 10:29:47 +07:00
"linux57_tkg")
linux57_rc_tkg="true"
;;
2020-08-19 05:29:28 +07:00
"linux58_tkg")
linux58_tkg="true"
;;
"linux59_rc_tkg")
linux59_rc_tkg="true"
2020-04-16 09:43:10 +07:00
;;
"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
}
2020-04-15 09:09:55 +07:00
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"
2020-04-16 09:43:10 +07:00
_main_loop