summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/NVIDIA-Linux-x86_64-$nvidiaver.run1
-rw-r--r--assets/d3dcompiler_47.dllbin4346120 -> 0 bytes
-rw-r--r--assets/dlss-enabler-setup-3.02.000.0.exebin32327234 -> 0 bytes
-rw-r--r--assets/fakenvapi.ini16
-rw-r--r--assets/innoextractbin1632672 -> 0 bytes
-rw-r--r--assets/nvapi64.dllbin544256 -> 0 bytes
-rwxr-xr-xassets/prepare.sh11
-rw-r--r--main.py87
8 files changed, 32 insertions, 83 deletions
diff --git a/assets/NVIDIA-Linux-x86_64-$nvidiaver.run b/assets/NVIDIA-Linux-x86_64-$nvidiaver.run
deleted file mode 100644
index 10af2fe..0000000
--- a/assets/NVIDIA-Linux-x86_64-$nvidiaver.run
+++ /dev/null
@@ -1 +0,0 @@
-Not found
diff --git a/assets/d3dcompiler_47.dll b/assets/d3dcompiler_47.dll
deleted file mode 100644
index b120261..0000000
--- a/assets/d3dcompiler_47.dll
+++ /dev/null
Binary files differ
diff --git a/assets/dlss-enabler-setup-3.02.000.0.exe b/assets/dlss-enabler-setup-3.02.000.0.exe
deleted file mode 100644
index c63578a..0000000
--- a/assets/dlss-enabler-setup-3.02.000.0.exe
+++ /dev/null
Binary files differ
diff --git a/assets/fakenvapi.ini b/assets/fakenvapi.ini
deleted file mode 100644
index f1f3c0c..0000000
--- a/assets/fakenvapi.ini
+++ /dev/null
@@ -1,16 +0,0 @@
-[fakenvapi]
-enable_logs=1
-
-enable_trace_logs=0
-
-; useful in native fsg fg games
-force_latencyflex=0
-
-; controls how latencyflex works
-; 0 = conservative
-; 1 = aggressive, will improve latency but in some cases will lower fps more than expected
-; 2 = use reflex frame ids, some games are not compatible (i.e. cyberpunk) and will fallback to aggressive
-latencyflex_mode=0
-
-; 0 - follow in-game setting, 1 - force disable, 2 - force enable
-force_reflex=0 \ No newline at end of file
diff --git a/assets/innoextract b/assets/innoextract
deleted file mode 100644
index a7fb871..0000000
--- a/assets/innoextract
+++ /dev/null
Binary files differ
diff --git a/assets/nvapi64.dll b/assets/nvapi64.dll
deleted file mode 100644
index f3d8051..0000000
--- a/assets/nvapi64.dll
+++ /dev/null
Binary files differ
diff --git a/assets/prepare.sh b/assets/prepare.sh
index debfede..57a1620 100755
--- a/assets/prepare.sh
+++ b/assets/prepare.sh
@@ -9,20 +9,13 @@ fakenvapiver=v1.2.0
standalone=1
if [[ -d "$mod_path" ]] && [[ ! $mod_path == . ]]; then
- read -p "$mod_path already exists, override the old version? [y/N] " -n 1 -r </dev/tty
- echo
- if [[ $REPLY =~ ^[Yy]$ ]]; then
- rm -r "$mod_path"
- else
- echo Aborting...
- exit 1
- fi
+ rm -r "$mod_path"
fi
# In case script gets ran from a different directory
cd $(dirname "$0")
-mkdir "$mod_path"
+mkdir -p "$mod_path"
if [[ ! $standalone -eq 0 ]]; then
[[ -f fgmod.sh ]] && cp fgmod.sh "$mod_path/fgmod" || exit 1
[[ -f fgmod-uninstaller.sh ]] && cp fgmod-uninstaller.sh "$mod_path" || exit 1
diff --git a/main.py b/main.py
index 878b576..94f45f0 100644
--- a/main.py
+++ b/main.py
@@ -40,63 +40,36 @@ class Plugin(PluginBase):
@callable
async def run_install_fgmod(self) -> dict:
- script = """
-#!/usr/bin/env bash
-
-set -euo pipefail
-trap 'echo "An error occurred. Exiting." && exit 1' ERR
-
-# Define paths
-zip_file="$HOME/homebrew/plugins/Decky-Framegen/assets/fgmod-1.5.1.zip"
-downloads_dir="$HOME/Downloads"
-destination_zip="$downloads_dir/fgmod-1.5.1.zip"
-
-# Step 1: Copy the ZIP file to Downloads if it doesn't already exist
-if [[ ! -f "$destination_zip" ]]; then
- echo "Copying ZIP file to Downloads directory..."
- cp "$zip_file" "$destination_zip" || { echo "Error: ZIP file not found at $zip_file"; exit 1; }
-else
- echo "ZIP file already exists in Downloads directory. Skipping copy."
-fi
-
-# Step 2: Navigate to Downloads
-cd "$downloads_dir"
-
-# Step 3: Extract the ZIP file
-echo "Extracting ZIP file..."
-unzip -o "$(basename "$destination_zip")" || { echo "Error: Failed to extract ZIP file."; exit 1; }
-
-# Step 4: Locate the extracted directory dynamically
-echo "Locating extracted directory..."
-extracted_dir=$(find . -maxdepth 1 -type d -name "fgmod*" ! -name "__MACOSX" | head -n 1)
-
-if [[ -d "$extracted_dir" ]]; then
- cd "$extracted_dir"
- echo "Navigated to extracted directory: $extracted_dir"
-else
- echo "Error: Extracted directory not found."
- exit 1
-fi
-
-# Step 5: Run the prepare.sh script and automatically answer "y"
-echo "Running prepare.sh..."
-if [[ -f "./prepare.sh" ]]; then
- chmod +x ./prepare.sh
- echo "y" | ./prepare.sh || { echo "Error: prepare.sh failed."; exit 1; }
-else
- echo "Error: prepare.sh not found in $extracted_dir"
- exit 1
-fi
-
-# Step 6: Signal success to the front end
-echo "Installation successful!"
-# Log the success explicitly for the frontend
-echo "STATUS: SUCCESS"
-
-exit 0
-"""
try:
- process = subprocess.run(script, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
+ # Define paths
+ assets_dir = Path("/home/deck/homebrew/plugins/Decky-Framegen/assets")
+ downloads_dir = Path.home() / "Downloads"
+
+ # Copy files to Downloads, overwriting if they exist
+ files_to_copy = ["prepare.sh", "fgmod.sh", "fgmod-uninstaller.sh"]
+ for file in files_to_copy:
+ src = assets_dir / file
+ dest = downloads_dir / file
+ if src.exists():
+ dest.write_bytes(src.read_bytes())
+ dest.chmod(0o755) # Make the file executable
+ else:
+ return {"status": "error", "message": f"{file} is missing in {assets_dir}"}
+
+ # Run prepare.sh
+ prepare_script = downloads_dir / "prepare.sh"
+ process = subprocess.run([str(prepare_script)], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
+
+ # Verify key files exist, if not create it
+ fgmod_path = Path("/home/deck/fgmod")
+ if not fgmod_path.exists():
+ fgmod_path.mkdir(parents=True)
+ return {"status": "info", "message": "fgmod directory was not found and has been created"}
+
+ # Check for success message
+ if "All done!" not in process.stdout:
+ return {"status": "error", "message": "Installation did not complete successfully"}
+
return {"status": "success", "output": process.stdout}
except subprocess.CalledProcessError as e:
return {"status": "error", "message": e.stderr}
@@ -105,4 +78,4 @@ exit 0
decky.logger.info("Plugin loaded.")
async def _unload(self):
- decky.logger.info("Plugin unloaded.") \ No newline at end of file
+ decky.logger.info("Plugin unloaded.")