|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | | -# https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc)#flatpak-applications |
| 3 | +echo "Setup Discord rich presence" |
4 | 4 | for i in {0..9}; do |
5 | | - test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i; |
| 5 | + test -S $XDG_RUNTIME_DIR/discord-ipc-$i || |
| 6 | + ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i; |
6 | 7 | done |
7 | 8 |
|
8 | | -project-plus-dolphin "$@" |
| 9 | +echo "Make directory /var/data/project-plus-dolphin/Wii if it doesn't exist" |
| 10 | +mkdir -p /var/data/project-plus-dolphin/Wii |
| 11 | + |
| 12 | +echo "Make directory /var/config/project-plus-dolphin if it doesn't exist" |
| 13 | +mkdir -p /var/config/project-plus-dolphin |
| 14 | + |
| 15 | +# Create and set variables for the system and user SD card creation dates |
| 16 | +# SystemSDCardCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/sys/Load/WiiSD.raw` |
| 17 | +# UserSDCardCreationDate=`stat --format="%W" /var/data/project-plus-dolphin/Load/WiiSD.raw` |
| 18 | + |
| 19 | +# echo "Check if there is a newer SD card version" |
| 20 | +# if [ $SystemSDCardCreationDate -gt ${UserSDCardCreationDate:=0} ]; |
| 21 | +# then |
| 22 | +# echo "Make directory /var/data/project-plus-dolphin/Load if it doesn't exist" |
| 23 | +# mkdir -p /var/data/project-plus-dolphin/Load |
| 24 | + |
| 25 | +# echo "Copy newer SD card to user data directory" |
| 26 | +# cp /app/share/project-plus-dolphin/sys/Load/WiiSD.raw /var/data/project-plus-dolphin/Load/WiiSD.raw |
| 27 | +# else |
| 28 | +# echo "SD card is already at latest version" |
| 29 | +# fi |
| 30 | + |
| 31 | +echo "Copy dol files to user data directory if they don't already exist" |
| 32 | +cp -nr /app/share/project-plus-dolphin/sys/Wii/Launcher /var/data/project-plus-dolphin/Wii/ |
| 33 | + |
| 34 | +echo "Copy user directory to Flatpak user data directory (Overwritting any files already there with any newer files)" |
| 35 | +cp -ru /app/share/project-plus-dolphin/user /var/data/project-plus-dolphin/ |
| 36 | + |
| 37 | +# Create and set variables for the system and user HD textures creation dates |
| 38 | +SystemHDTexturesCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/sys/Load/Textures/RSBE01` |
| 39 | +UserHDTexturesCreationDate=`stat --format="%W" /var/data/project-plus-dolphin/Load/Textures/RSBE01` |
| 40 | + |
| 41 | +echo "Check if there are newer HD textures" |
| 42 | +if [ $SystemHDTexturesCreationDate -gt ${UserHDTexturesCreationDate:=0} ]; |
| 43 | +then |
| 44 | + echo "Make directory /var/data/project-plus-dolphin/Load/Textures if it doesn't exist" |
| 45 | + mkdir -p /var/data/project-plus-dolphin/Load/Textures |
| 46 | + |
| 47 | + echo "Copy newer HD textures to user data directory" |
| 48 | + cp -r /app/share/project-plus-dolphin/sys/Load/Textures/RSBE01 /var/data/project-plus-dolphin/Load/Textures |
| 49 | +else |
| 50 | + echo "HD textures are already at latest version" |
| 51 | +fi |
| 52 | + |
| 53 | +# Launch Dolphin and point it to the user directory |
| 54 | +project-plus-dolphin -u /var/data/project-plus-dolphin/user "$@" |
0 commit comments