Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved theme, favorites, and recent list to be profile specific #1270

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 22 additions & 1 deletion static/packages/App/Guest Mode/App/Guest_Mode/launch.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
#!/bin/sh
progdir=`cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P`

json_file="/mnt/SDCARD/system.json"
currentThemefile="/mnt/SDCARD/Saves/CurrentProfile/theme/currentTheme"

progdir=`cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P`
cd $progdir

# Save current time
./saveTime.sh
sync

# Save current Favourites + RecentList lists
cp /mnt/SDCARD/Roms/*.json /mnt/SDCARD/Saves/CurrentProfile/lists
rm /mnt/SDCARD/Roms/*.json

# Save current theme
jq -r .theme "$json_file" > "$currentThemefile"

if [ -d /mnt/SDCARD/Saves/GuestProfile ] ; then
# The main profile is the current one
cp ./data/configON.json ./config.json
mv /mnt/SDCARD/Saves/CurrentProfile /mnt/SDCARD/Saves/MainProfile
mv /mnt/SDCARD/Saves/GuestProfile /mnt/SDCARD/Saves/CurrentProfile

else
# The guest profile is the current one
cp ./data/configOFF.json ./config.json
mv /mnt/SDCARD/Saves/CurrentProfile /mnt/SDCARD/Saves/GuestProfile
mv /mnt/SDCARD/Saves/MainProfile /mnt/SDCARD/Saves/CurrentProfile
fi

# Favourites + RecentList restoration
cp /mnt/SDCARD/Saves/CurrentProfile/lists/*.json /mnt/SDCARD/Roms

# Theme restoration
if [ -e "$currentThemefile" ]; then
jq --arg theme "$(cat "$currentThemefile")" '.theme = $theme' "$json_file" > temp.json
mv temp.json "$json_file"
fi
themeSwitcher --reapply_icons

# Load current time
./loadTime.sh