-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcurl_install.sh
executable file
·68 lines (51 loc) · 2.46 KB
/
curl_install.sh
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
#!/bin/bash
#Steam Deck Shader Cache Killer by scawp
#License: DBAD: https://github.com/scawp/Steam-Deck.Shader-Cache-Killer/blob/main/LICENSE.md
#Source: https://github.com/scawp/Steam-Deck-Shader.Cache-Killer
#stop running script if anything returns an error (non-zero exit )
set -e
repo_url="https://raw.githubusercontent.com/scawp/Steam-Deck.Shader-Cache-Killer/main"
tmp_dir="/tmp/scawp.SDSCK.install"
script_install_dir="/home/deck/.local/share/scawp/SDSCK"
device_name="$(uname --nodename)"
user="$(id -u deck)"
if [ "$device_name" !='' "steamdeck" ] || [ "$user" != "1000" ]; then
zenity --question --width=400 \
--text="This code has been written specifically for the Steam Deck with user Deck \
\nIt appears you are running on a different system/non-standard configuration. \
\nAre you sure you want to continue?"
if [ "$?" != 0 ]; then
#NOTE: This code will never be reached due to "set -e", the system will already exit for us but just incase keep this
echo "bye then! xxx"
exit 1;
fi
fi
function install_zShaderCacheKiller () {
zenity --question --width=400 \
--text="Read $repo_url/README.md before proceeding. \
\nWould you like to add Shader Cache Killer to your Steam Library?"
if [ "$?" != 0 ]; then
#NOTE: This code will never be reached due to "set -e", the system will already exit for us but just incase keep this
echo "bye then! xxx"
exit 0;
fi
echo "Making tmp folder $tmp_dir"
mkdir -p "$tmp_dir"
echo "Making install folder $script_install_dir"
mkdir -p "$script_install_dir"
echo "Downloading Required Files"
curl -o "$tmp_dir/zShaderCacheKiller.sh" "$repo_url/zShaderCacheKiller.sh"
curl -o "$tmp_dir/zShaderCacheMover.sh" "$repo_url/zShaderCacheMover.sh"
echo "Copying $tmp_dir/zShaderCacheKiller.sh to $script_install_dir/zShaderCacheKiller.sh"
sudo cp "$tmp_dir/zShaderCacheKiller.sh" "$script_install_dir/zShaderCacheKiller.sh"
echo "Copying $tmp_dir/zShaderCacheMover.sh to $script_install_dir/zShaderCacheMover.sh"
sudo cp "$tmp_dir/zShaderCacheMover.sh" "$script_install_dir/zShaderCacheMover.sh"
echo "Adding Execute and Removing Write Permissions"
sudo chmod 555 "$script_install_dir/zShaderCacheKiller.sh"
sudo chmod 555 "$script_install_dir/zShaderCacheMover.sh"
add_killer="$(steamos-add-to-steam "$script_install_dir/zShaderCacheKiller.sh")"
sleep 2;
add_mover="$(steamos-add-to-steam "$script_install_dir/zShaderCacheMover.sh")"
}
install_zShaderCacheKiller
echo "Done."