5 Commits

Author SHA1 Message Date
MiaPepsi 5a0955c135 Merge pull request #1 from john-okeefe/new-menu
Added option to remove cache from SD Card. Created new menu.
2022-10-20 01:27:03 -04:00
John O'Keefe df55717c69 improved sd card detection and added checks 2022-10-19 00:23:47 +00:00
John O'Keefe 0487435885 updated messages after action. set universal vars 2022-09-28 11:23:58 -04:00
John O'Keefe bc2b77660b Added option to remove cache from Card. New menu 2022-09-27 12:27:31 -04:00
MiaPepsi ff816c2f08 Add files via upload
added the ability to move shadercache to the SD card with a symbolic link
2022-09-22 17:41:24 -04:00
2 changed files with 108 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
#! /bin/bash
# this script will clear the shadercache folder from your steamdeck
shadersize=$(du -sh /home/deck/.steam/steam/steamapps/shadercache)
SD=1 # OK button return code =0 , all others =1
mover=0
while [ $SD -eq 1 ]; do
ans=$(zenity --info --title 'Confirm deletion' \
--text="shadercache size: $shadersize \n\n do you wish to clear this data?" --no-wrap \
--ok-label Quit \
--extra-button yes \
--extra-button no \
--extra-button "move shaderache to SD card" \
)
SD=$?
echo "${SD}-${ans}"
echo $ans
if [[ $ans = "yes" ]]
then
rm -r /home/deck/.steam/steam/steamapps/shadercache
zenity --info --title="Success" --text="shadercache folder was sucessfully deleted" --no-wrap
SD=0
elif [[ $ans = "no" ]]
then
zenity --info --title="no content deleted" --text="The shadercache folder was not deleted" --no-wrap
SD=0
elif [[ $ans = "move shaderache to SD card" ]]
then
if zenity --question --title="Confirm move" --text="move shadercache to SDcard?" --no-wrap
then
mv /home/deck/.steam/steam/steamapps/shadercache /run/media/mmcblk0p1/steamapps/
ln -s /run/media/mmcblk0p1/steamapps/ /home/deck/.steam/steam/steamapps/shadercache
SD=0
zenity --info --title="Success" --text="shadercache folder was sucessfully moved to the SD card" --no-wrap
else
zenity --info --title="no content moved" --text="The shadercache folder was not moved" --no-wrap
fi
fi
done
+58
View File
@@ -0,0 +1,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