dotaxis / 7thDeck

Installer for 7th Heaven on Steam Deck
84 stars 5 forks source link

Linux branch issues #18

Closed infirit closed 5 months ago

infirit commented 5 months ago

I tried the linux branch and these are the issues I ran into so far.

dotaxis commented 5 months ago

I'll admit the Linux branch has been a bit neglected, and should already have been updated to download stable versions. I'll work on this throughout the week.

infirit commented 5 months ago

I tested the dev branch today.

The vdf file. libraryfolders.vdf.zip

kdialog was not installed anymore (don't ask me why) so the script failed. On the deck and plasma distributions it'll most likely but there are many distro's that don't. In the future it may be worth checking for kdialog, zenity or if all fails use dialog.

infirit commented 5 months ago

Here are a couple suggestions to handle the xdg directories.

--- install.sh.orig 2025-01-20 16:47:27.351332029 +0100
+++ install.sh  2024-01-20 16:50:16.933699184 +0100
@@ -2,6 +2,9 @@
 . deps/functions.sh
 PROTON=$(LIBRARY=$(getSteamLibrary 1887720) && [ -n "$LIBRARY" ] && echo "$LIBRARY/steamapps/common/Proton 7.0/proton" || echo "NONE")
 RUNTIME=$(LIBRARY=$(getSteamLibrary 1391110) && [ -n "$LIBRARY" ] && echo "$LIBRARY/steamapps/common/SteamLinuxRuntime_soldier/run" || echo "NONE")
+XDG_DESKTOP_DIR=$(xdg-user-dir DESKTOP)
+XDG_DATA_HOME="${XDG_DATA_HOME:=${HOME}/.local/share}"
+

 [ ! -d "temp" ] && mkdir temp
 echo "" > "7thDeck.log"
@@ -115,9 +118,9 @@
 # Add shortcut to Desktop/Launcher
 echo "Adding 7th Heaven to Desktop and Launcher"
 xdg-icon-resource install deps/7th-heaven.png --size 64 --novendor
-mkdir -p "${HOME}/.local/share/applications" &>> "7thDeck.log"
+mkdir -p "${XDG_DATA_HOME}/applications" &>> "7thDeck.log"
 # Launcher
-rm -r "${HOME}/.local/share/applications/7th Heaven.desktop" 2> /dev/null
+rm -r "${XDG_DATA_HOME}/applications/7th Heaven.desktop" 2> /dev/null
 echo "#!/usr/bin/env xdg-open
 [Desktop Entry]
 Name=7th Heaven
@@ -127,10 +130,10 @@
 Categories=Game;
 Terminal=false
 Type=Application
-StartupNotify=false" > "${HOME}/.local/share/applications/7th Heaven.desktop"
-chmod +x "${HOME}/.local/share/applications/7th Heaven.desktop"
+StartupNotify=false" > "${XDG_DATA_HOME}/applications/7th Heaven.desktop"
+chmod +x "${XDG_DATA_HOME}/applications/7th Heaven.desktop"
 # Desktop
-rm -r "${HOME}/Desktop/7th Heaven.desktop" 2> /dev/null
+rm -r "${XDG_DESKTOP_DIR}/7th Heaven.desktop" 2> /dev/null
 echo "#!/usr/bin/env xdg-open
 [Desktop Entry]
 Name=7th Heaven
@@ -140,23 +143,23 @@
 Categories=Game;
 Terminal=false
 Type=Application
-StartupNotify=false" > "${HOME}/Desktop/7th Heaven.desktop"
-chmod +x "${HOME}/Desktop/7th Heaven.desktop"
-update-desktop-database ~/.local/share/applications &>> "7thDeck.log"
+StartupNotify=false" > "${XDG_DESKTOP_DIR}/7th Heaven.desktop"
+chmod +x "${XDG_DESKTOP_DIR}/7th Heaven.desktop"
+update-desktop-database ${XDG_DATA_HOME}/applications &>> "7thDeck.log"
 echo

 # Add launcher to Steam
 echo "Adding 7th Heaven to Steam..."
-deps/steamos-add-to-steam "${HOME}/.local/share/applications/7th Heaven.desktop" &>> "7thDeck.log"
+deps/steamos-add-to-steam "${XDG_DATA_HOME}/applications/7th Heaven.desktop" &>> "7thDeck.log"
 sleep 5
 echo

 # Force FF7 under Proton 7
 echo "Forcing Final Fantasy VII to run under Proton 7.0"
 pkill -9 steam
-cp ${HOME}/.local/share/Steam/config/config.vdf ${HOME}/.local/share/Steam/config/config.vdf.bak
+cp ${XDG_DATA_HOME}/Steam/config/config.vdf ${XDG_DATA_HOME}/Steam/config/config.vdf.bak
 perl -0777 -i -pe 's/"CompatToolMapping"\n\s+{/"CompatToolMapping"\n\t\t\t\t{\n\t\t\t\t\t"39140"\n\t\t\t\t\t{\n\t\t\t\t\t\t"name"\t\t"proton_7"\n\t\t\t\t\t\t"config"\t\t""\n\t\t\t\t\t\t"priority"\t\t"250"\n\t\t\t\t\t}/gs' \
-${HOME}/.local/share/Steam/config/config.vdf
+${XDG_DATA_HOME}/Steam/config/config.vdf
 # Thanks ChatGPT
 nohup steam &> /dev/null &
 echo

edit: and one that saves the installed to the user's cache directory.

--- functions.sh.orig   2025-01-20 17:36:50.520927743 +0100
+++ functions.sh    2024-01-20 17:33:42.510034158 +0100
@@ -18,6 +18,7 @@

 # Download from GitHub
 downloadDependency() {
+  local XDG_CACHE_HOME="${XDG_CACHE_HOME:=${HOME}/.cache}"
   local REPO=$1
   local FILTER=$2
   local RETURN_VARIABLE=$3
@@ -27,7 +28,7 @@
     | head -1 \
     | cut -d : -f 2,3 \
     | tr -d \")
-  local FILENAME="temp/$(basename "$RELEASE_URL")"
+  local FILENAME="${XDG_CACHE_HOME}/$(basename "$RELEASE_URL")"
   if [ -f "$FILENAME" ]; then
     echo "$FILENAME is ready to be installed."
   else
dotaxis commented 5 months ago

I didn't properly test the getSteamLibrary function so I had to rewrite it. It should be fine now.

Thanks for your suggestions! I have applied them. Can you test the latest commits?

infirit commented 5 months ago

As mentioned on discord. I was able to get it to install by using a bottles to install vcredist and dotnet. Also opened #20 with a couple fixes.

infirit commented 5 months ago

Thanks for helping with making this work. It still has issues but apparently there are some issues with where I put my library. I'll keep playing on windows for now.