RetroDECK/tools/cheevos.sh
2022-09-03 17:51:02 +02:00

19 lines
700 B
Bash
Executable file

#!/bin/bash
racfg=""
login=$(zenity --forms --title="RetroAchievements Login" \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--text="Enter your RetroAchievements Account details.\n\nBe aware that this tool cannot verify your login details.\nFor registration and more info visit\nhttps://retroachievements.org/\n" \
--separator="=SEP=" \
--add-entry="Username" \
--add-password="Password")
arrIN=(${login//=SEP=/ })
user=${arrIN[0]}
pass=${arrIN[1]}
sed -i "s%cheevos_enable =.*%cheevos_enable = \"true\"" $racfg
sed -i "s%cheevos_username =.*%cheevos_username = \"$user\"" $racfg
sed -i "s%cheevos_password =.*%cheevos_password = \"$pass\"" $racfg