Skip to content

Commit

Permalink
bye dolphin & citra zenity
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Dec 29, 2024
1 parent 224aaf5 commit e460f01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 42 deletions.
10 changes: 0 additions & 10 deletions functions/EmuScripts/emuDeckCitra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,6 @@ Citra_flushSymlinks(){
find "$STEAMPATH/userdata" -name "shortcuts.vdf" -exec sed -i "s|${romsPath}/3ds|${romsPath}/n3ds|g" {} +
touch "$HOME/.config/EmuDeck/.citralegacysymlinks"
echo "Citra symlink cleanup completed."
zenity --info \
--text="Citra symlinks have been cleaned. This cleanup was conducted to prevent any potential breakage with symlinks. Place all new ROMs in Emulation/roms/n3ds. Your ROMs have been moved from Emulation/roms/3ds to Emulation/roms/n3ds." \
--title="Symlink Update" \
--width=400 \
--height=300

else
echo "Citra symlinks already cleaned."
Expand Down Expand Up @@ -366,11 +361,6 @@ Citra_flushSymlinks(){
find "$STEAMPATH/userdata" -name "shortcuts.vdf" -exec sed -i "s|${romsPath}/3ds|${romsPath}/n3ds|g" {} +
touch "$HOME/.config/EmuDeck/.citrasymlinks"
echo "Citra symlink cleanup completed."
zenity --info \
--text="Citra symlinks have been cleaned. This cleanup was conducted to prevent any potential breakage with symlinks. Place all new ROMs in Emulation/roms/n3ds. Your ROMs have been moved from Emulation/roms/3ds to Emulation/roms/n3ds." \
--title="Symlink Update" \
--width=400 \
--height=300

else
echo "Citra symlinks already cleaned."
Expand Down
53 changes: 21 additions & 32 deletions functions/EmuScripts/emuDeckDolphin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Dolphin_install(){

#ApplyInitialSettings
Dolphin_init(){

setMSG "${Dolphin_emuName}: Apply initial config"
echo ""
configEmuFP "${Dolphin_emuName}" "${Dolphin_emuPath}" "true"
Expand Down Expand Up @@ -243,14 +243,14 @@ Dolphin_flushSymlinks(){
rm -rf "$romsPath/gc/metadata.txt" &> /dev/null
rm -rf "$romsPath/gc/systeminfo.txt" &> /dev/null

# The Pegasus install was accidentally overwriting the pre-existing n3ds symlink.
# This checks if the gc folder is empty (post-removing the contents above) and if the original gamecube folder is still a folder and not a symlink (for those who have already migrated).
# If all of this is true, the gc folder is deleted and the old symlink is temporarily recreated to proceed with the migration.
# The Pegasus install was accidentally overwriting the pre-existing n3ds symlink.
# This checks if the gc folder is empty (post-removing the contents above) and if the original gamecube folder is still a folder and not a symlink (for those who have already migrated).
# If all of this is true, the gc folder is deleted and the old symlink is temporarily recreated to proceed with the migration.
if [[ ! "$( ls -A "$romsPath/gc")" ]] && [ -d "$romsPath/gamecube" ] && [ ! -L "$romsPath/gamecube" ]; then
rm -rf "$romsPath/gc"
ln -sfn "$romsPath/gamecube" "$romsPath/gc"
# Temporarily restores old directory structure.
fi
ln -sfn "$romsPath/gamecube" "$romsPath/gc"
# Temporarily restores old directory structure.
fi

if [[ -L "$romsPath/gc" && ! $(readlink -f "$romsPath/gc") =~ ^"$romsPath" ]] || [[ -L "$romsPath/gamecube" && ! $(readlink -f "$romsPath/gamecube") =~ ^"$romsPath" ]]; then
echo "User has symlinks that don't match expected paths located under $romsPath. Aborting symlink update."
Expand Down Expand Up @@ -278,22 +278,16 @@ Dolphin_flushSymlinks(){

rsync -avh "$EMUDECKGIT/roms/gc/." "$romsPath/gc/." --ignore-existing

if [ -d "$toolsPath/downloaded_media/gc" ] && [ ! -d "$romsPath/gc/media" ]; then
if [ -d "$toolsPath/downloaded_media/gc" ] && [ ! -d "$romsPath/gc/media" ]; then
ln -s "$toolsPath/downloaded_media/gc" "$romsPath/gc/media"
fi

find "$STEAMPATH/userdata" -name "shortcuts.vdf" -exec sed -i "s|${romsPath}/gamecube|${romsPath}/gc|g" {} +
touch "$HOME/.config/EmuDeck/.dolphinlegacysymlinks"
touch "$HOME/.config/EmuDeck/.dolphinlegacysymlinks"
echo "Dolphin symlink cleanup completed."
zenity --info \
--text="Dolphin symlinks have been cleaned. This cleanup was conducted to prevent any potential breakage with symlinks. Place all new ROMs in Emulation/roms/gc. Your ROMs have been moved from Emulation/roms/gamecube to Emulation/roms/gc." \
--title="Symlink Update" \
--width=400 \
--height=300

else
else
echo "Dolphin symlinks already cleaned."
fi
fi

if [ ! -f "$HOME/.config/EmuDeck/.dolphinsymlinks" ]; then

Expand All @@ -303,14 +297,14 @@ Dolphin_flushSymlinks(){
rm -rf "$romsPath/gc/metadata.txt" &> /dev/null
rm -rf "$romsPath/gc/systeminfo.txt" &> /dev/null

# The Pegasus install was accidentally overwriting the pre-existing n3ds symlink.
# This checks if the gc folder is empty (post-removing the contents above) and if the original gamecube folder is still a folder and not a symlink (for those who have already migrated).
# If all of this is true, the gc folder is deleted and the old symlink is temporarily recreated to proceed with the migration.
# The Pegasus install was accidentally overwriting the pre-existing n3ds symlink.
# This checks if the gc folder is empty (post-removing the contents above) and if the original gamecube folder is still a folder and not a symlink (for those who have already migrated).
# If all of this is true, the gc folder is deleted and the old symlink is temporarily recreated to proceed with the migration.
if [[ ! "$( ls -A "$romsPath/gc")" ]] && [ -d "$romsPath/gamecube" ] && [ ! -L "$romsPath/gamecube" ]; then
rm -rf "$romsPath/gc"
ln -sfn "$romsPath/gamecube" "$romsPath/gc"
# Temporarily restores old directory structure.
fi
ln -sfn "$romsPath/gamecube" "$romsPath/gc"
# Temporarily restores old directory structure.
fi

if [[ -L "$romsPath/gc" && ! $(readlink -f "$romsPath/gc") =~ ^"$romsPath" ]] || [[ -L "$romsPath/gamecube" && ! $(readlink -f "$romsPath/gamecube") =~ ^"$romsPath" ]]; then
echo "User has symlinks that don't match expected paths located under $romsPath. Aborting symlink update."
Expand Down Expand Up @@ -338,21 +332,16 @@ Dolphin_flushSymlinks(){

rsync -avh "$EMUDECKGIT/roms/gc/." "$romsPath/gc/." --ignore-existing

if [ -d "$toolsPath/downloaded_media/gc" ] && [ ! -d "$romsPath/gc/media" ]; then
if [ -d "$toolsPath/downloaded_media/gc" ] && [ ! -d "$romsPath/gc/media" ]; then
ln -s "$toolsPath/downloaded_media/gc" "$romsPath/gc/media"
fi

find "$STEAMPATH/userdata" -name "shortcuts.vdf" -exec sed -i "s|${romsPath}/gamecube|${romsPath}/gc|g" {} +
touch "$HOME/.config/EmuDeck/.dolphinsymlinks"
touch "$HOME/.config/EmuDeck/.dolphinsymlinks"
echo "Dolphin symlink cleanup completed."
zenity --info \
--text="Dolphin symlinks have been cleaned. This cleanup was conducted to prevent any potential breakage with symlinks. Place all new ROMs in Emulation/roms/gc. Your ROMs have been moved from Emulation/roms/gamecube to Emulation/roms/gc." \
--title="Symlink Update" \
--width=400 \
--height=300

else
else
echo "Dolphin symlinks already cleaned."
fi
fi

}

0 comments on commit e460f01

Please sign in to comment.