diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-22 10:34:43 -0500 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-22 10:34:43 -0500 |
| commit | 94bb49822beb9a525c9d29cf452cb6dd47b4fb2b (patch) | |
| tree | 4aeea5dab1ff1c7073487390ba1342c71d871026 | |
| parent | 9e4dcc39af0aeacf47e1fb1cd8ec22635040d2ae (diff) | |
| download | Decky-Framegen-94bb49822beb9a525c9d29cf452cb6dd47b4fb2b.tar.gz Decky-Framegen-94bb49822beb9a525c9d29cf452cb6dd47b4fb2b.zip | |
bundled assets, will need to review if thats problematic
| -rw-r--r-- | assets/NVIDIA-Linux-x86_64-$nvidiaver.run | 1 | ||||
| -rw-r--r-- | assets/d3dcompiler_47.dll | bin | 0 -> 4346120 bytes | |||
| -rw-r--r-- | assets/dlss-enabler-setup-3.02.000.0.exe | bin | 0 -> 32327234 bytes | |||
| -rw-r--r-- | assets/fakenvapi.ini | 16 | ||||
| -rw-r--r-- | assets/innoextract | bin | 0 -> 1632672 bytes | |||
| -rw-r--r-- | assets/logo.png | bin | 21108 -> 0 bytes | |||
| -rw-r--r-- | assets/nvapi64.dll | bin | 0 -> 544256 bytes | |||
| -rw-r--r-- | main.py | 120 |
8 files changed, 58 insertions, 79 deletions
diff --git a/assets/NVIDIA-Linux-x86_64-$nvidiaver.run b/assets/NVIDIA-Linux-x86_64-$nvidiaver.run new file mode 100644 index 0000000..10af2fe --- /dev/null +++ b/assets/NVIDIA-Linux-x86_64-$nvidiaver.run @@ -0,0 +1 @@ +Not found diff --git a/assets/d3dcompiler_47.dll b/assets/d3dcompiler_47.dll Binary files differnew file mode 100644 index 0000000..b120261 --- /dev/null +++ b/assets/d3dcompiler_47.dll diff --git a/assets/dlss-enabler-setup-3.02.000.0.exe b/assets/dlss-enabler-setup-3.02.000.0.exe Binary files differnew file mode 100644 index 0000000..c63578a --- /dev/null +++ b/assets/dlss-enabler-setup-3.02.000.0.exe diff --git a/assets/fakenvapi.ini b/assets/fakenvapi.ini new file mode 100644 index 0000000..f1f3c0c --- /dev/null +++ b/assets/fakenvapi.ini @@ -0,0 +1,16 @@ +[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 Binary files differnew file mode 100644 index 0000000..a7fb871 --- /dev/null +++ b/assets/innoextract diff --git a/assets/logo.png b/assets/logo.png Binary files differdeleted file mode 100644 index 48c4851..0000000 --- a/assets/logo.png +++ /dev/null diff --git a/assets/nvapi64.dll b/assets/nvapi64.dll Binary files differnew file mode 100644 index 0000000..f3d8051 --- /dev/null +++ b/assets/nvapi64.dll @@ -43,95 +43,57 @@ class Plugin(PluginBase): script = """ #!/usr/bin/env bash -set -euo pipefail # Exit on error, undefined variable, or pipe failure -trap 'echo "An error occurred. Exiting."' ERR +set -euo pipefail +trap 'echo "An error occurred. Exiting." && exit 1' ERR # Define paths -assets_path="$HOME/homebrew/plugins/Decky-Framegen/assets" -mod_path="$assets_path" -nvidiaver=555.52.04 -enablerver=3.02.000.0 -fakenvapiver=v1.2.0 - -# Ensure the assets directory exists -if [[ ! -d "$assets_path" ]]; then - echo "Error: Assets directory does not exist at $assets_path!" - exit 1 +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 -# Clear existing mod files -echo "Preparing mod directory..." -rm -rf "$mod_path"/* -mkdir -p "$mod_path" - -# Copy fgmod scripts from assets -echo "Copying fgmod scripts..." -cp "$assets_path/fgmod.sh" "$mod_path/fgmod" || { echo "Error: fgmod.sh not found in assets!"; exit 1; } -cp "$assets_path/fgmod-uninstaller.sh" "$mod_path/fgmod-uninstaller.sh" || { echo "Error: fgmod-uninstaller.sh not found in assets!"; exit 1; } - -# Navigate to mod_path -cd "$mod_path" - -# Download required files -echo "Downloading required files..." -curl -OLf "https://github.com/artur-graniszewski/DLSS-Enabler/releases/download/$enablerver/dlss-enabler-setup-$enablerver.exe" -curl -OLf "https://download.nvidia.com/XFree86/Linux-x86_64/$nvidiaver/NVIDIA-Linux-x86_64-$nvidiaver.run" -curl -OLf "https://raw.githubusercontent.com/mozilla/fxc2/master/dll/d3dcompiler_47.dll" -curl -OLf "https://github.com/FakeMichau/innoextract/releases/download/6.3.0/innoextract" -curl -OLf "https://github.com/FakeMichau/fakenvapi/releases/download/$fakenvapiver/fakenvapi.7z" - -# Validate downloads -echo "Validating downloaded files..." -required_files=( - "dlss-enabler-setup-$enablerver.exe" - "NVIDIA-Linux-x86_64-$nvidiaver.run" - "d3dcompiler_47.dll" - "innoextract" - "fakenvapi.7z" -) - -for file in "${required_files[@]}"; do - if [[ ! -f $file ]]; then - echo "Error: Missing required file: $file" - exit 1 - fi -done - -# Extract and prepare files -echo "Extracting and preparing files..." -chmod +x NVIDIA-Linux-x86_64-$nvidiaver.run innoextract -./NVIDIA-Linux-x86_64-$nvidiaver.run -x -./innoextract dlss-enabler-setup-$enablerver.exe - -mv app/* . || true -rm -r app || true -if command -v 7z &>/dev/null; then - 7z -y x fakenvapi.7z -fi +# Step 2: Navigate to Downloads +cd "$downloads_dir" -cp -f NVIDIA-Linux-x86_64-$nvidiaver/nvngx.dll _nvngx.dll -cp -f NVIDIA-Linux-x86_64-$nvidiaver/LICENSE "licenses/LICENSE (NVIDIA driver)" -chmod +r _nvngx.dll +# Step 3: Extract the ZIP file +echo "Extracting ZIP file..." +unzip -o "$(basename "$destination_zip")" || { echo "Error: Failed to extract ZIP file."; exit 1; } -# Cleanup unnecessary files -echo "Cleaning up temporary files..." -rm -rf innoextract NVIDIA-Linux-x86_64-$nvidiaver dlss-enabler-setup-$enablerver.exe \ - NVIDIA-Linux-x86_64-$nvidiaver.run fakenvapi.7z +# 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) -# Update script paths -sed -i "s|mod_path=\"/usr/share/fgmod\"|mod_path=\"$mod_path\"|g" "$mod_path/fgmod" "$mod_path/fgmod-uninstaller.sh" -chmod +x "$mod_path/fgmod" "$mod_path/fgmod-uninstaller.sh" +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 -# Handle Flatpak Steam -if flatpak list | grep -q "com.valvesoftware.Steam"; then - echo "Flatpak version of Steam detected. Granting access to $mod_path." - flatpak override --user --filesystem="$mod_path" com.valvesoftware.Steam - echo "Please restart Steam for changes to take effect." +# 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 -echo "All done!" -echo "For Steam, add this to the launch options: \"$mod_path/fgmod\" %COMMAND%" -echo "For Heroic, add this as a new wrapper: \"$mod_path/fgmod\"" +# 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) |
