Pegasus config update

This commit is contained in:
Rodrigo 2023-11-30 10:19:26 +01:00
parent 40d3f875c2
commit 6de3c0078d
5 changed files with 34 additions and 32 deletions

View file

@ -2,7 +2,7 @@
#variables
Pegasus_toolName="Pegasus Frontend"
Pegasus_emuPath="org.pegasus_frontend.Pegasus"
Pegasus_path="$HOME/.var/app/$Pegasus_emuPath"
Pegasus_path="$HOME/.var/app/$Pegasus_emuPath/config"
Pegasus_dir_file="$HOME/.var/app/$Pegasus_emuPath/pegasus-frontend/game_dirs.txt"
Pegasus_config_file="$HOME/.var/app/$Pegasus_emuPath/pegasus-frontend/settings.txt"
@ -30,17 +30,30 @@ Pegasus_init(){
rsync -avhp --mkpath "$EMUDECKGIT/configs/$Pegasus_emuPath/" "$Pegasus_path/"
#metadata and cores paths
#metadata and paths
rsync -r "$EMUDECKGIT/roms/" "$romsPath"
rsync -av -f"+ */" -f"- *" "$EMUDECKGIT/roms/" "$toolsPath/downloaded_media"
find $romsPath -type f -name "metadata.txt" -exec sed -i "s|CORESPATH|${RetroArch_cores}|g" {} \;
sed -i "s|/run/media/mmcblk0p1/Emulation|${emulationPath}|g" "$Pegasus_dir_file"
for systemPath in "$romsPath"/*; do rm -rf "$systemPath/media" &> /dev/null; done
for systemPath in "$romsPath"/*; do system=$(echo "$systemPath" | sed 's/.*\/\([^\/]*\)\/\?$/\1/'); ln -s "$toolsPath/downloaded_media/$system" "$systemPath/media" &> /dev/null; done
#Pegasus_addCustomSystems
#Pegasus_setEmulationFolder
#Pegasus_setDefaultEmulators
Pegasus_applyTheme "$pegasusTheme"
user=$(zenity --entry --title="ScreenScrapper" --text="User:")
password=$(zenity --password --title="ScreenScrapper" --text="Password:")
encryption_key=$(openssl rand -base64 32)
encrypted_password=$(echo "$password" | openssl enc -aes-256-cbc -pbkdf2 -base64 -pass "pass:$encryption_key")
echo "$encryption_key" > "$HOME/.config/EmuDeck/logs/.key"
echo "$encrypted_password" > "$HOME/.config/EmuDeck/.passSS"
echo "$user" > "$HOME/.config/EmuDeck/.userSS"
}

View file

@ -6,7 +6,7 @@ romParser_RA_download(){
local type=$3
case "$type" in
"screenshot")
"%20")
RA_folder="Named_Snaps"
;;
@ -181,24 +181,16 @@ romParser_RA_start(){
do
system=$(echo "$systemPath" | sed 's/.*\/\([^\/]*\)\/\?$/\1/')
if [[ "$systemPath" == *txt* ]]; then
if [[ "$systemPath" == *tx* ]]; then
break
fi
if [ ! -d "$systemPath/media/" ]; then
echo -e "Creating $systemPath/media..."
mkdir $systemPath/media &> /dev/null
mkdir $systemPath/media/screenshot &> /dev/null
mkdir $systemPath/media/box2dfront &> /dev/null
mkdir $systemPath/media/wheel &> /dev/null
fi
#Getting roms
i=0
for romPath in $systemPath/*;
do
#Validating
if [ -f "$romPath" ] && [ "$(basename "$romPath")" != ".*" ] && [[ "$romPath" != *".txt" ]] && [[ "$(basename "$romPath")" != *".exe" ]] && [[ "$(basename "$romPath")" != *".conf" ]] && [[ "$(basename "$romPath")" != *".xml" ]]; then
if [ -f "$romPath" ] && [ "$(basename "$romPath")" != ".*" ] && [[ "$romPath" != *".tx" ]] && [[ "$(basename "$romPath")" != *".exe" ]] && [[ "$(basename "$romPath")" != *".conf" ]] && [[ "$(basename "$romPath")" != *".xml" ]]; then
#Cleaning rom directory
romfile=$(echo "$romPath" | sed 's/.*\/\([^\/]*\)\/\?$/\1/')
@ -211,7 +203,7 @@ romParser_RA_start(){
#We get the folder RA uses
(romParser_RA_getAlias $system
romParser_RA_download "$romName" $system "screenshot"
romParser_RA_download "$romName" $system "box2dfront") |
romParser_RA_download "$romName" $system "covers") |
zenity --progress \
--title="EmuDeck RetroArch Parser" \
--text="Downloading artwork for $system..." \

View file

@ -4,13 +4,18 @@ romParser_SS_download(){
local system=$2
local type=$3
local userSS=$(cat "$HOME/emudeck/.userSS")
local passSS=$(cat "$HOME/emudeck/.passSS")
local encryption_key=$(cat "$HOME/.config/EmuDeck/logs/.key")
local encrypted_password=$(cat "$HOME/.config/EmuDeck/.passSS")
local decrypted_password=$(echo "$encrypted_password" | openssl enc -d -aes-256-cbc -pbkdf2 -base64 -pass "pass:$encryption_key")
local passSS=$decrypted_password
#local ssID Set but calling romParser_SS_getAlias before
case "$type" in
"wheel")
"marquees")
media="wheel"
;;
"screenshot")
"screenshots")
media="ss"
;;
*)
@ -347,20 +352,12 @@ romParser_SS_start(){
for systemPath in $romsPath/*;
do
if [[ "$systemPath" == *txt* ]]; then
if [[ "$systemPath" == *tx* ]]; then
break
fi
system=$(echo "$systemPath" | sed 's/.*\/\([^\/]*\)\/\?$/\1/')
if [ ! -d "$systemPath/media/" ]; then
echo -e "Creating $systemPath/media..."
mkdir $systemPath/media &> /dev/null
mkdir $systemPath/media/screenshot &> /dev/null
mkdir $systemPath/media/box2dfront &> /dev/null
mkdir $systemPath/media/wheel &> /dev/null
fi
romNumber=$(find "$systemPath" -maxdepth 1 -type f | wc -l)
#Getting roms
@ -368,7 +365,7 @@ romParser_SS_start(){
for romPath in $systemPath/*;
do
#Validating
if [ -f "$romPath" ] && [ "$(basename "$romPath")" != ".*" ] && [[ "$romPath" != *".txt" ]] && [[ "$(basename "$romPath")" != *".exe" ]] && [[ "$(basename "$romPath")" != *".conf" ]] && [[ "$(basename "$romPath")" != *".xml" ]]; then
if [ -f "$romPath" ] && [ "$(basename "$romPath")" != ".*" ] && [[ "$romPath" != *".tx" ]] && [[ "$(basename "$romPath")" != *".exe" ]] && [[ "$(basename "$romPath")" != *".conf" ]] && [[ "$(basename "$romPath")" != *".xml" ]]; then
#Cleaning rom directory
romfile=$(echo "$romPath" | sed 's/.*\/\([^\/]*\)\/\?$/\1/')
@ -381,9 +378,9 @@ romParser_SS_start(){
(
#We get the ssID for later
romParser_SS_getAlias $system
romParser_SS_download "$romName" $system "screenshot"
romParser_SS_download "$romName" $system "box2dfront"
romParser_SS_download "$romName" $system "wheel"
romParser_SS_download "$romName" $system "screenshots"
romParser_SS_download "$romName" $system "covers"
romParser_SS_download "$romName" $system "marquees"
) |
zenity --progress \
--title="EmuDeck ScreenScraper Parser" \