mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 14:05:39 +00:00
Update controller profile
Add GitHub API reachability check to online version check
This commit is contained in:
parent
2badb902dc
commit
1bc98a1713
|
@ -1,18 +1,18 @@
|
||||||
"controller_mappings"
|
"controller_mappings"
|
||||||
{
|
{
|
||||||
"version" "3"
|
"version" "3"
|
||||||
"revision" "1556"
|
"revision" "1581"
|
||||||
"title" "RetroDECK: Official Layout - v.0.7b"
|
"title" "RetroDECK: Official Layout - v0.7b"
|
||||||
"description" "The Official RetroDECK Layout"
|
"description" "The Official RetroDECK Layout""
|
||||||
"creator" ""
|
"creator" ""
|
||||||
"progenitor" ""
|
"progenitor" ""
|
||||||
"url" "autosave:///home/deck/.local/share/Steam/steamapps/common/Steam Controller Configs/25233020/config/retrodeck/controller_neptune.vdf"
|
"url" ""
|
||||||
"export_type" "template"
|
"export_type" "personal_cloud"
|
||||||
"controller_type" "controller_neptune"
|
"controller_type" "controller_neptune"
|
||||||
"controller_caps" "23117823"
|
"controller_caps" "23117823"
|
||||||
"major_revision" "0"
|
"major_revision" "0"
|
||||||
"minor_revision" "0"
|
"minor_revision" "0"
|
||||||
"Timestamp" "-999421760"
|
"Timestamp" "-1230584288"
|
||||||
"actions"
|
"actions"
|
||||||
{
|
{
|
||||||
"Default"
|
"Default"
|
||||||
|
@ -708,14 +708,6 @@
|
||||||
"binding" "key_press RETURN, FULLSCREEN TOGGLE, , "
|
"binding" "key_press RETURN, FULLSCREEN TOGGLE, , "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"Full_Press"
|
|
||||||
{
|
|
||||||
"bindings"
|
|
||||||
{
|
|
||||||
"binding" "key_press LEFT_ALT, , "
|
|
||||||
"binding" "key_press RETURN, , "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"disabled_activators"
|
"disabled_activators"
|
||||||
{
|
{
|
||||||
|
@ -1561,14 +1553,6 @@
|
||||||
"binding" "key_press RETURN, Fullscreen On/Off, RD-zoom-fit-best.png, #232323 #FFFFFF"
|
"binding" "key_press RETURN, Fullscreen On/Off, RD-zoom-fit-best.png, #232323 #FFFFFF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"Full_Press"
|
|
||||||
{
|
|
||||||
"bindings"
|
|
||||||
{
|
|
||||||
"binding" "key_press LEFT_ALT, , "
|
|
||||||
"binding" "key_press RETURN, , "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"disabled_activators"
|
"disabled_activators"
|
||||||
{
|
{
|
||||||
|
@ -2748,14 +2732,6 @@
|
||||||
"binding" "key_press RETURN, Fullscreen On/Off, RD-zoom-fit-best.png, "
|
"binding" "key_press RETURN, Fullscreen On/Off, RD-zoom-fit-best.png, "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"Full_Press"
|
|
||||||
{
|
|
||||||
"bindings"
|
|
||||||
{
|
|
||||||
"binding" "key_press LEFT_ALT, , "
|
|
||||||
"binding" "key_press RETURN, , "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"disabled_activators"
|
"disabled_activators"
|
||||||
{
|
{
|
||||||
|
@ -2803,8 +2779,8 @@
|
||||||
{
|
{
|
||||||
"bindings"
|
"bindings"
|
||||||
{
|
{
|
||||||
"binding" "key_press LEFT_ALT, Change Dual-Screenlayout, RD-preferences-system-windows-actions.png, "
|
"binding" "key_press LEFT_CONTROL, Change Dual-Screenlayout, RD-preferences-system-windows-actions.png, "
|
||||||
"binding" "key_press 0, Change Dual-Screenlayout, RD-preferences-system-windows-actions.png, "
|
"binding" "key_press L, Change Dual-Screenlayout, RD-preferences-system-windows-actions.png, "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3183,8 +3159,8 @@
|
||||||
{
|
{
|
||||||
"bindings"
|
"bindings"
|
||||||
{
|
{
|
||||||
"binding" "key_press LEFT_CONTROL, Open Menu, RD-preferences-desktop-icons.png, "
|
"binding" "key_press LEFT_CONTROL, Exit / Quit Emulator, RD-process-stop.png, "
|
||||||
"binding" "key_press M, Open Menu, RD-preferences-desktop-icons.png, "
|
"binding" "key_press ESCAPE, Exit / Quit Emulator, RD-process-stop.png, "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3200,8 +3176,8 @@
|
||||||
{
|
{
|
||||||
"bindings"
|
"bindings"
|
||||||
{
|
{
|
||||||
"binding" "key_press LEFT_CONTROL, Exit / Quit Emulator, RD-process-stop.png, "
|
"binding" "key_press LEFT_CONTROL, Open Menu, RD-preferences-desktop-icons.png, "
|
||||||
"binding" "key_press ESCAPE, Exit / Quit Emulator, RD-process-stop.png, "
|
"binding" "key_press M, Open Menu, RD-preferences-desktop-icons.png, "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3748,7 +3724,7 @@
|
||||||
"bindings"
|
"bindings"
|
||||||
{
|
{
|
||||||
"binding" "key_press LEFT_ALT, ALT + F4, RD-F4.png, "
|
"binding" "key_press LEFT_ALT, ALT + F4, RD-F4.png, "
|
||||||
"binding" "controller_action empty_sub_command, ALT + F4, RD-F4.png, "
|
"binding" "key_press F4, ALT + F4, RD-F4.png, "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,58 +27,64 @@ check_desktop_mode() {
|
||||||
check_for_version_update() {
|
check_for_version_update() {
|
||||||
# This function will perform a basic online version check and alert the user if there is a new version available.
|
# This function will perform a basic online version check and alert the user if there is a new version available.
|
||||||
|
|
||||||
local online_version=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
wget -q --spider "https://api.github.com/repos/XargonWan/$update_repo/releases/latest"
|
||||||
|
|
||||||
if [[ ! "$update_ignore" == "$online_version" ]]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then
|
local online_version=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||||
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \
|
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
if [[ ! "$update_ignore" == "$online_version" ]]; then
|
||||||
--title "RetroDECK Update Available" \
|
if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then
|
||||||
--text="There is a new version of RetroDECK available!\nYou are running version $hard_version, the latest is $online_version.\n\nIf you would like to update to the new version now, click \"Yes\".\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.")
|
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \
|
||||||
rc=$? # Capture return code, as "Yes" button has no text value
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
--title "RetroDECK Update Available" \
|
||||||
if [[ $choice == "Ignore this version" ]]; then
|
--text="There is a new version of RetroDECK available!\nYou are running version $hard_version, the latest is $online_version.\n\nIf you would like to update to the new version now, click \"Yes\".\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.")
|
||||||
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks
|
rc=$? # Capture return code, as "Yes" button has no text value
|
||||||
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
||||||
|
if [[ $choice == "Ignore this version" ]]; then
|
||||||
|
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks
|
||||||
|
fi
|
||||||
|
else # User clicked "Yes"
|
||||||
|
configurator_generic_dialog "RetroDECK Online Update" "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
|
||||||
|
(
|
||||||
|
flatpak-spawn --host flatpak update --noninteractive -y net.retrodeck.retrodeck
|
||||||
|
) |
|
||||||
|
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
||||||
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
|
--title "RetroDECK Updater" \
|
||||||
|
--text="RetroDECK is updating to the latest version, please wait."
|
||||||
|
configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else # User clicked "Yes"
|
elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $version == $online_version ]]; then
|
||||||
configurator_generic_dialog "RetroDECK Online Update" "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
|
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \
|
||||||
(
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
flatpak-spawn --host flatpak update --noninteractive -y net.retrodeck.retrodeck
|
--title "RetroDECK Update Available" \
|
||||||
) |
|
--text="There is a more recent build of the RetroDECK cooker branch.\nYou are running version $hard_version, the latest is $online_version.\n\nWould you like to update to it?\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.")
|
||||||
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
rc=$? # Capture return code, as "Yes" button has no text value
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
||||||
--title "RetroDECK Updater" \
|
if [[ $choice == "Ignore this version" ]]; then
|
||||||
--text="RetroDECK is updating to the latest version, please wait."
|
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks.
|
||||||
configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going."
|
fi
|
||||||
exit 1
|
else # User clicked "Yes"
|
||||||
fi
|
configurator_generic_dialog "RetroDECK Online Update" "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
|
||||||
elif [[ "$update_repo" == "RetroDECK-cooker" ]] && [[ ! $version == $online_version ]]; then
|
(
|
||||||
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Yes" --extra-button="No" --extra-button="Ignore this version" \
|
local latest_cooker_download=$(curl --silent https://api.github.com/repos/XargonWan/$update_repo/releases/latest | grep '"browser_download_url":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
mkdir -p "$rdhome/RetroDECK_Updates"
|
||||||
--title "RetroDECK Update Available" \
|
wget -P "$rdhome/RetroDECK_Updates" $latest_cooker_download
|
||||||
--text="There is a more recent build of the RetroDECK cooker branch.\nYou are running version $hard_version, the latest is $online_version.\n\nWould you like to update to it?\nIf you would like to skip reminders about this version, click \"Ignore this version\".\nYou will be reminded again at the next version update.\n\nIf you would like to disable these update notifications entirely, disable Online Update Checks in the Configurator.")
|
flatpak-spawn --host flatpak install --user --bundle --noninteractive -y "$rdhome/RetroDECK_Updates/RetroDECK.flatpak"
|
||||||
rc=$? # Capture return code, as "Yes" button has no text value
|
rm -rf "$rdhome/RetroDECK_Updates" # Cleanup old bundles to save space
|
||||||
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
) |
|
||||||
if [[ $choice == "Ignore this version" ]]; then
|
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
||||||
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks.
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
|
--title "RetroDECK Updater" \
|
||||||
|
--text="RetroDECK is updating to the latest version, please wait."
|
||||||
|
configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else # User clicked "Yes"
|
|
||||||
configurator_generic_dialog "RetroDECK Online Update" "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
|
|
||||||
(
|
|
||||||
local latest_cooker_download=$(curl --silent https://api.github.com/repos/XargonWan/$update_repo/releases/latest | grep '"browser_download_url":' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
||||||
mkdir -p "$rdhome/RetroDECK_Updates"
|
|
||||||
wget -P "$rdhome/RetroDECK_Updates" $latest_cooker_download
|
|
||||||
flatpak-spawn --host flatpak install --user --bundle --noninteractive -y "$rdhome/RetroDECK_Updates/RetroDECK.flatpak"
|
|
||||||
rm -rf "$rdhome/RetroDECK_Updates" # Cleanup old bundles to save space
|
|
||||||
) |
|
|
||||||
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
|
||||||
--title "RetroDECK Updater" \
|
|
||||||
--text="RetroDECK is updating to the latest version, please wait."
|
|
||||||
configurator_generic_dialog "RetroDECK Online Update" "The update process is now complete!\n\nPlease restart RetroDECK to keep the fun going."
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else # Unable to reach the GitHub API for some reason
|
||||||
|
configurator_generic_dialog "RetroDECK Online Update" "RetroDECK is unable to reach the GitHub API to perform a version check.\nIt's possible that location is being blocked by your network or ISP.\n\nIf the problem continues, you will need to disable internal checks through the Configurator\nand perform updates manually through the Discover store."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue