From 9e2fa60e5452630676f10bc6d91ce5040f8baac5 Mon Sep 17 00:00:00 2001 From: Zoull Date: Sat, 3 Jun 2023 14:09:26 -0600 Subject: [PATCH 1/5] Add files used to fix Humble App logins --- humble-app/Humble-scheme-handler.desktop | 6 ++++++ humble-app/handle-humble-scheme | 11 +++++++++++ humble-app/start-humble.cmd | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 humble-app/Humble-scheme-handler.desktop create mode 100644 humble-app/handle-humble-scheme create mode 100644 humble-app/start-humble.cmd diff --git a/humble-app/Humble-scheme-handler.desktop b/humble-app/Humble-scheme-handler.desktop new file mode 100644 index 0000000..2b0c2c2 --- /dev/null +++ b/humble-app/Humble-scheme-handler.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Humble App (Login) +Comment=Target for handling Humble App logins. You should not run this manually. +Exec=/home/deck/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/handle-humble-scheme %u +Type=Application +MimeType=x-scheme-handler/humble; \ No newline at end of file diff --git a/humble-app/handle-humble-scheme b/humble-app/handle-humble-scheme new file mode 100644 index 0000000..0c98223 --- /dev/null +++ b/humble-app/handle-humble-scheme @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +set -e + +export STEAM_COMPAT_CLIENT_INSTALL_PATH=~/.local/share/Steam +export STEAM_COMPAT_DATA_PATH=~/.steam/steam/Steam/steamapps/compatdata/NonSteamLaunchers +FIXED_SCHEME="$(echo "$1" | sed "s/?/\//")" + +echo $FIXED_SCHEME > /home/deck/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/.auth + +~/.steam/steam/steamapps/common/Proton\ -\ Experimental/proton run ~/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/start-humble.cmd \ No newline at end of file diff --git a/humble-app/start-humble.cmd b/humble-app/start-humble.cmd new file mode 100644 index 0000000..1e449c1 --- /dev/null +++ b/humble-app/start-humble.cmd @@ -0,0 +1,12 @@ +@echo off + +cd /d "C:\Program Files\Humble App\" +set /p Url=<"C:\.auth" + +if defined Url ( + start "" "Humble App.exe" "%Url%" +) else ( + start "" "Humble App.exe" "%*" +) + +exit \ No newline at end of file From 32392ce5a24f48b9bb6e2f6b23b98a50b29a419f Mon Sep 17 00:00:00 2001 From: Zoull Date: Sat, 3 Jun 2023 15:31:15 -0600 Subject: [PATCH 2/5] Try and make Humble login scripts generic and test replacement in script --- NonSteamLaunchers.sh | 23 +++++++++++++++++++---- humble-app/Humble-scheme-handler.desktop | 2 +- humble-app/handle-humble-scheme | 6 +++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 0760c7c..820d300 100644 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -1843,16 +1843,31 @@ if [[ $options == *"Humble Games Collection"* ]]; then # User selected Humble Games Launcher echo "User selected Humble Games Collection" + if [[ ! -f "$HOME/.local/share/applications/Humble-scheme-handler.desktop" ]]; then + wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/Humble-scheme-handler.desktop -O /tmp/Humble-scheme-handler.desktop + cat /tmp/Humble-scheme-handler.desktop | sed "s/{{APPID}}/$appid/" > /tmp/Humble-scheme-handler.desktop + desktop-file-install --rebuild-mime-info-cache --dir=$HOME/.local/share/applications /tmp/Humble-scheme-handler.desktop + rm -rf /tmp/Humble-scheme-handler.desktop + fi + if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" ]]; then + wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/handle-humble-scheme -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + cat "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" | sed "s/{{APPID}}/$appid/ > "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + chmod +x "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + fi + + if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/start-humble.cmd" ]]; then + wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/start-humble.cmd -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/start-humble.cmd" + fi if [[ ! -f "$humblegames_path1" ]] && [[ ! -f "$humblegames_path2" ]]; then # Humble Games Launcher is not installed # Set the appid for the Humble Games Launcher if [ "$use_separate_appids" = true ]; then - appid=HumbleGamesLauncher + appid=HumbleGamesLauncher else - appid=NonSteamLaunchers + appid=NonSteamLaunchers fi @@ -2150,11 +2165,11 @@ elif [[ -f "$legacygames_path2" ]]; then fi if [[ -f "$humblegames_path1" ]]; then # Humble Games Launcher is installed at path 1 - humbleshortcutdirectory="\"$humblegames_path1\"" + humbleshortcutdirectory="\"$HOME/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/start-humble.cmd\"" humblelaunchoptions="STEAM_COMPAT_DATA_PATH=\"$HOME/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/\" %command%" elif [[ -f "$humblegames_path2" ]]; then # Humble Games Launcher is installed at path 2 - humbleshortcutdirectory="\"$humblegames_path2\"" + humbleshortcutdirectory="\"$HOME/.local/share/Steam/steamapps/compatdata/HumbleGamesLauncher/pfx/start-humble.cmd\"" humblelaunchoptions="STEAM_COMPAT_DATA_PATH=\"$HOME/.local/share/Steam/steamapps/compatdata/HumbleGamesLauncher/\" %command%" fi if [[ -f "$indiegala_path1" ]]; then diff --git a/humble-app/Humble-scheme-handler.desktop b/humble-app/Humble-scheme-handler.desktop index 2b0c2c2..ae585af 100644 --- a/humble-app/Humble-scheme-handler.desktop +++ b/humble-app/Humble-scheme-handler.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Humble App (Login) Comment=Target for handling Humble App logins. You should not run this manually. -Exec=/home/deck/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/handle-humble-scheme %u +Exec=/home/deck/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/handle-humble-scheme %u Type=Application MimeType=x-scheme-handler/humble; \ No newline at end of file diff --git a/humble-app/handle-humble-scheme b/humble-app/handle-humble-scheme index 0c98223..b96952d 100644 --- a/humble-app/handle-humble-scheme +++ b/humble-app/handle-humble-scheme @@ -3,9 +3,9 @@ set -e export STEAM_COMPAT_CLIENT_INSTALL_PATH=~/.local/share/Steam -export STEAM_COMPAT_DATA_PATH=~/.steam/steam/Steam/steamapps/compatdata/NonSteamLaunchers +export STEAM_COMPAT_DATA_PATH=~/.steam/steam/Steam/steamapps/compatdata/{{APPID}} FIXED_SCHEME="$(echo "$1" | sed "s/?/\//")" -echo $FIXED_SCHEME > /home/deck/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/drive_c/.auth +echo $FIXED_SCHEME > /home/deck/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/drive_c/.auth -~/.steam/steam/steamapps/common/Proton\ -\ Experimental/proton run ~/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/pfx/start-humble.cmd \ No newline at end of file +~/.steam/steam/steamapps/common/Proton\ -\ Experimental/proton run ~/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/start-humble.cmd \ No newline at end of file From 6f83974959e94da05337f945c0c155c8fd43e85c Mon Sep 17 00:00:00 2001 From: Zoull Date: Sat, 3 Jun 2023 15:49:33 -0600 Subject: [PATCH 3/5] Try and make Humble login scripts generic and test replacement in script --- NonSteamLaunchers.sh | 4 ++-- humble-app/Humble-scheme-handler.desktop | 2 +- humble-app/handle-humble-scheme | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 820d300..d0e4ec2 100644 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -1845,14 +1845,14 @@ if [[ $options == *"Humble Games Collection"* ]]; then if [[ ! -f "$HOME/.local/share/applications/Humble-scheme-handler.desktop" ]]; then wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/Humble-scheme-handler.desktop -O /tmp/Humble-scheme-handler.desktop - cat /tmp/Humble-scheme-handler.desktop | sed "s/{{APPID}}/$appid/" > /tmp/Humble-scheme-handler.desktop + cat /tmp/Humble-scheme-handler.desktop | sed "s/APPID/$appid/" > /tmp/Humble-scheme-handler.desktop desktop-file-install --rebuild-mime-info-cache --dir=$HOME/.local/share/applications /tmp/Humble-scheme-handler.desktop rm -rf /tmp/Humble-scheme-handler.desktop fi if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" ]]; then wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/handle-humble-scheme -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" - cat "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" | sed "s/{{APPID}}/$appid/ > "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + cat "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" | sed "s/APPID/$appid/ > "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" chmod +x "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" fi diff --git a/humble-app/Humble-scheme-handler.desktop b/humble-app/Humble-scheme-handler.desktop index ae585af..b05bead 100644 --- a/humble-app/Humble-scheme-handler.desktop +++ b/humble-app/Humble-scheme-handler.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Humble App (Login) Comment=Target for handling Humble App logins. You should not run this manually. -Exec=/home/deck/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/handle-humble-scheme %u +Exec=/home/deck/.local/share/Steam/steamapps/compatdata/APPID/pfx/handle-humble-scheme %u Type=Application MimeType=x-scheme-handler/humble; \ No newline at end of file diff --git a/humble-app/handle-humble-scheme b/humble-app/handle-humble-scheme index b96952d..35331a7 100644 --- a/humble-app/handle-humble-scheme +++ b/humble-app/handle-humble-scheme @@ -3,9 +3,9 @@ set -e export STEAM_COMPAT_CLIENT_INSTALL_PATH=~/.local/share/Steam -export STEAM_COMPAT_DATA_PATH=~/.steam/steam/Steam/steamapps/compatdata/{{APPID}} +export STEAM_COMPAT_DATA_PATH=~/.steam/steam/Steam/steamapps/compatdata/APPID FIXED_SCHEME="$(echo "$1" | sed "s/?/\//")" -echo $FIXED_SCHEME > /home/deck/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/drive_c/.auth +echo $FIXED_SCHEME > /home/deck/.local/share/Steam/steamapps/compatdata/APPID/pfx/drive_c/.auth -~/.steam/steam/steamapps/common/Proton\ -\ Experimental/proton run ~/.local/share/Steam/steamapps/compatdata/{{APPID}}/pfx/start-humble.cmd \ No newline at end of file +~/.steam/steam/steamapps/common/Proton\ -\ Experimental/proton run ~/.local/share/Steam/steamapps/compatdata/APPID/pfx/start-humble.cmd \ No newline at end of file From b289c39f07077245d79931a4ceedb573cddaa00a Mon Sep 17 00:00:00 2001 From: Zoull Date: Sat, 3 Jun 2023 16:03:33 -0600 Subject: [PATCH 4/5] Found and fixed quote issue breaking sed replacement --- NonSteamLaunchers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index d0e4ec2..b157bcb 100644 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -1845,14 +1845,14 @@ if [[ $options == *"Humble Games Collection"* ]]; then if [[ ! -f "$HOME/.local/share/applications/Humble-scheme-handler.desktop" ]]; then wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/Humble-scheme-handler.desktop -O /tmp/Humble-scheme-handler.desktop - cat /tmp/Humble-scheme-handler.desktop | sed "s/APPID/$appid/" > /tmp/Humble-scheme-handler.desktop + sed -i "s/APPID/$appid/" /tmp/Humble-scheme-handler.desktop desktop-file-install --rebuild-mime-info-cache --dir=$HOME/.local/share/applications /tmp/Humble-scheme-handler.desktop rm -rf /tmp/Humble-scheme-handler.desktop fi if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" ]]; then wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/handle-humble-scheme -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" - cat "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" | sed "s/APPID/$appid/ > "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + sed -i "s/APPID/$appid/" "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" chmod +x "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" fi From 9a1959782318b3b2e68e46aac2deaa987dd63ed6 Mon Sep 17 00:00:00 2001 From: Zoull Date: Sat, 3 Jun 2023 16:10:04 -0600 Subject: [PATCH 5/5] Change download urls for files to fix Humble App logins to main GitHub repo --- NonSteamLaunchers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index b157bcb..3aa9efd 100644 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -1844,20 +1844,20 @@ if [[ $options == *"Humble Games Collection"* ]]; then echo "User selected Humble Games Collection" if [[ ! -f "$HOME/.local/share/applications/Humble-scheme-handler.desktop" ]]; then - wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/Humble-scheme-handler.desktop -O /tmp/Humble-scheme-handler.desktop + wget https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/humble-app/Humble-scheme-handler.desktop -O /tmp/Humble-scheme-handler.desktop sed -i "s/APPID/$appid/" /tmp/Humble-scheme-handler.desktop desktop-file-install --rebuild-mime-info-cache --dir=$HOME/.local/share/applications /tmp/Humble-scheme-handler.desktop rm -rf /tmp/Humble-scheme-handler.desktop fi if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" ]]; then - wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/handle-humble-scheme -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" + wget https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/humble-app/handle-humble-scheme -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" sed -i "s/APPID/$appid/" "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" chmod +x "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/handle-humble-scheme" fi if [[ ! -f "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/start-humble.cmd" ]]; then - wget https://raw.githubusercontent.com/Zoullx/NonSteamLaunchers-On-Steam-Deck/fix-humble-login/humble-app/start-humble.cmd -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/start-humble.cmd" + wget https://raw.githubusercontent.com/moraroy/NonSteamLaunchers-On-Steam-Deck/main/humble-app/start-humble.cmd -O "$HOME/.local/share/Steam/steamapps/compatdata/$appid/pfx/start-humble.cmd" fi if [[ ! -f "$humblegames_path1" ]] && [[ ! -f "$humblegames_path2" ]]; then