Skip to content

Commit 09cf29b

Browse files
committed
Bottles: check for alternative native bottles dir
1 parent 57a2c61 commit 09cf29b

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

bottles_setup.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/bash
22

33
nvlibs_dir="$(dirname "$(readlink -fm "$0")")"
4-
bottles_dir="$HOME/.var/app/com.usebottles.bottles/data/bottles/bottles"
4+
bottles_dir="$HOME/.var/app/com.usebottles.bottles/data/bottles"
55
win='drive_c/windows/system32'
66
lib='x64'
77

8+
# Check flatpak and native bottles_dir
9+
[ -d "$bottles_dir" ] || bottles_dir="$HOME/.local/share/bottles"
10+
[ -d "$bottles_dir" ] || {
11+
echo "Bottles directory not found."
12+
exit 1
13+
}
14+
815
if [ ! -f "$nvlibs_dir/$lib/nvcuda.dll" ]; then
916
echo "Files not found in $nvlibs_dir/$lib" >&2
1017
exit 1
@@ -14,21 +21,21 @@ if [ -z "$1" ]; then
1421
echo -ne "BOTTLE is not set!\n"
1522
echo -ne "This is a list of your available bottles:\n"
1623
echo -ne "\n=========================================\n"
17-
ls -1 $bottles_dir
24+
ls -1 "$bottles_dir/bottles"
1825
echo -ne "=========================================\n\n"
1926
echo -ne "Specify your bottle. Eg: ./bottles-install.sh MyBottle\n"
2027
exit 1
2128
fi
2229

23-
if [ ! -f "$bottles_dir/$1/$win/dxgi.dll" ]; then
24-
echo -ne "Windows files not found in $bottles_dir\$1! check bottle installation\n" >&2
30+
if [ ! -f "$bottles_dir/bottles/$1/$win/dxgi.dll" ]; then
31+
echo -e "Windows files not found in $bottles_dir/bottles/$1! Check bottle installation." >&2
2532
exit 1
2633
else
2734
BOTTLE="$1"
2835
fi
2936

3037
function install {
31-
cp -f "$nvlibs_dir/$lib/$1" "$bottles_dir/$BOTTLE/$win/"
38+
cp -f "$nvlibs_dir/$lib/$1" "$bottles_dir/bottles/$BOTTLE/$win/"
3239
}
3340

3441
fun=install
@@ -46,7 +53,7 @@ echo
4653
if [[ "$response" =~ ^[Yy]$ ]]; then
4754
lib='x64'
4855
nvapi_ver="dxvk-nvapi-$(cat version | grep DXVK | cut -d' ' -f2- | tr -d '\"')"
49-
nvapi_dir="$HOME/.var/app/com.usebottles.bottles/data/bottles/nvapi/$nvapi_ver"
56+
nvapi_dir="$bottles_dir/nvapi/$nvapi_ver"
5057
if [ -f "$nvapi_dir/$lib/nvapi64.dll" ]; then
5158
echo -ne "Already installed! Skipping\n" >&2
5259
else

0 commit comments

Comments
 (0)