Last active
January 3, 2026 21:22
-
-
Save nukhes/ecc665c139dba17271dba195d4785e91 to your computer and use it in GitHub Desktop.
Install lsfg-vk on Linux systems with an alternative version of Lossless Scaling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install lsfg-vk on Linux systems with an alternative version of Lossless Scaling, without the need to purchase it. | |
| # Supports every Linux x86_64 machine | |
| DOWNLOAD_URL="https://github.com/PancakeTAS/lsfg-vk/releases/download/v1.0.0/lsfg-vk-1.0.0.x86_64.tar.zst" | |
| TEMP_FILE="/tmp/lsfg_install.tar.zst" | |
| INSTALL_DIR="/" | |
| # Install LSFG-VK Release | |
| if [ -f /etc/os-release ]; then | |
| . /etc/os-release | |
| if [[ "$ID" == "ubuntu" || "$ID" == "debian" || "$ID_LIKE" == *"debian"* ]]; then | |
| sudo apt-get update | |
| sudo apt-get install -y wget zstd qt6-qpa-plugins libqt6quick6 qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtquick-window qml6-module-qtquick-dialogs qml6-module-qtqml-workerscript qml6-module-qtquick-templates | |
| elif [[ "$ID" == "fedora" || "$ID" == "nobara" || "$ID_LIKE" == *"fedora"* ]]; then | |
| sudo dnf install -y wget zstd qt6-qtdeclarative qt6-qtbase | |
| elif [[ "$ID" == "arch" || "$ID_LIKE" == *"arch"* ]]; then | |
| sudo pacman -Sy --noconfirm wget zstd qt6-declarative qt6-base | |
| else | |
| echo "Cannot install dependencies out of the box, handle these by youself (mostly qt6 stuff and wget)" | |
| fi | |
| else | |
| echo "Cannot detect OS information, skipping dependencies installation..." | |
| fi | |
| wget -O "$TEMP_FILE" "$DOWNLOAD_URL" | |
| sudo tar --use-compress-program=unzstd -xvf "$TEMP_FILE" -C "$INSTALL_DIR" | |
| sudo chmod 755 /usr/bin/lsfg-vk-ui | |
| # Download original Lossless.dll | |
| # VirusTotal analysis for this file: https://www.virustotal.com/gui/file/d8bde39e48f7ea12ad3e709354d3c321d3e470ea4db617e3fc64bf0becb3cd43/details | |
| # SHA256: d8bde39e48f7ea12ad3e709354d3c321d3e470ea4db617e3fc64bf0becb3cd43 | |
| wget -O "$HOME/.local/usr/lib/Lossless.dll" "https://files.catbox.moe/ppy9g5.dll" | |
| # Create an uninstall script | |
| cat <<EOF | sudo tee "/usr/uninstall-lsfg.sh" > /dev/null | |
| #!/bin/bash | |
| sudo rm -f "/.PKGINFO" | |
| sudo rm -f "/usr/lib/liblsfg-vk.so" | |
| sudo rm -f "/usr/bin/lsfg-vk-ui" | |
| sudo rm -f "/usr/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json" | |
| sudo rm -f "/usr/share/applications/lsfg-vk-ui.desktop" | |
| sudo rm -f "/usr/share/icons/hicolor/256x256/apps/gay.pancake.lsfg-vk-ui.png" | |
| sudo rm -f "$HOME/.local/usr/lib/Lossless.dll" | |
| sudo rm -f "\$0" | |
| echo "Uninstalled LSFG-VK" | |
| EOF | |
| sudo chmod 755 "/usr/uninstall-lsfg.sh" | |
| # Patch VkLayer_LS_frame_generation.json for proper locate "liblsfg-vk.so" | |
| sudo sed -i "s|\"library_path\": \"liblsfg-vk.so\"|\"library_path\": \"/usr/lib/liblsfg-vk.so\"|" "/usr/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json" | |
| # Patch user LSFG-VK config to locate "Lossless.dll" | |
| mkdir -p "$HOME/.config/lsfg-vk" | |
| cat > "$HOME/.config/lsfg-vk/conf.toml" <<EOF | |
| version = 1 | |
| [global] | |
| dll = "$HOME/.local/usr/lib/Lossless.dll" | |
| [[game]] | |
| exe = "games" | |
| multiplier = 3 | |
| flow_scale = 1.0 | |
| performance_mode = true | |
| hdr_mode = false | |
| experimental_present_mode = "fifo" | |
| EOF | |
| # Refresh launcher icons to get lsfg-vk gui | |
| sudo update-desktop-database /usr/share/applications | |
| echo "Installation finished successfully" | |
| echo "When launch LSFG-VK ensure 'Lossless.dll' is set to '~/.local/usr/lib/Lossless.dll'." | |
| echo "If you want to uninstall you can run '/usr/uninstall-lsfg.sh'" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with one command.
curl -fsSL https://gist.githubusercontent.com/nukhes/ecc665c139dba17271dba195d4785e91/raw/ | sh