-
Notifications
You must be signed in to change notification settings - Fork 6
/
deckcleaner1.3.sh
executable file
·58 lines (53 loc) · 2.6 KB
/
deckcleaner1.3.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
#!/bin/bash
# this script will clear the shadercache folder from your steamdeck
# get SD Card name (Thank you EmuDeck for this)
if [ -b "/dev/mmcblk0p1" ]; then
sdCard=$(findmnt -n --raw --evaluate --output=target -S /dev/mmcblk0p1)
sdshadersize=$(shopt -s lastpipe; du -sh ${sdCard}/steamapps/shadercache | grep -E -o "(.*[GMK])")
fi
# sdCard=$(ls /run/media | grep -ve '^deck$' | head -n1)
internalshadersize=$(shopt -s lastpipe; du -sh $HOME/.steam/steam/steamapps/shadercache | grep -E -o "(.*[GMK])")
PS3='Please enter your choice: '
if [ -b "/dev/mmcblk0p1" ]; then
options=(
"Remove ${internalshadersize:=0B} of shadercache from internal storage."
"Remove ${sdshadersize:=0B} of shadercache from SD card."
"Move ${internalshadersize} of shadercache from internal storage to SD card."
"Quit"
)
else options=(
"Remove ${internalshadersize:=0B} of shadercache from internal storage."
"SD Card Not Found"
"Quit"
)
fi
while opt=$(zenity --width=500 --height=250 --title="$title" --text="$prompt" --list --column="Options" "${options[@]}");
do
case "$opt" in
"${options[0]}" )
rm -r /home/deck/.steam/steam/steamapps/shadercache
zenity --info --title="Success" --text="The shadercache folder was sucessfully deleted from internal storage." --no-wrap
options[0]="The shadercache folder was sucessfully deleted from internal storage."
options[2]="Shader folder cannot be moved. Does not exist."
;;
"${options[1]}" )
if [ -b "/dev/mmcblk0p1" ]; then
rm -r ${sdCard}/steamapps/shadercache
zenity --info --title="Success" --text="The shadercache folder was sucessfully deleted from SD card." --no-wrap
options[1]="The shadercache folder was sucessfully deleted from SD card."
else break
fi
;;
"${options[2]}" )
if [ -b "/dev/mmcblk0p1" ]; then
mv /home/deck/.steam/steam/steamapps/shadercache ${sdCard}/steamapps/
ln -s ${sdCard}/steamapps/ /home/deck/.steam/steam/steamapps/shadercache
zenity --info --title="Success" --text="The shadercache folder was sucessfully moved to the SD card." --no-wrap
options[2]="The shadercache folder was sucessfully moved to the SD card."
else break
fi
;;
"${options[3]}" ) break;;
*) zenity --error --text="Invalid option. Try another one.";;
esac
done