An all-in-one setup and maintenance toolkit for running Fedora KDE on the XMG Pro 16 VE M25 laptop (and compatible Clevo/Uniwill chassis with hybrid NVIDIA/Intel graphics), plus automated fixers for DaVinci Resolve Studio, Google Antigravity IDE, and Razer peripherals.
You do not need to manually download or run individual scripts one by one. This repository includes an interactive master control menu:
# 1. Clone or download this repository
git clone https://github.com/DenisJosifoski/xmg-linux-scripts.git
cd xmg-linux-scripts
# 2. Launch the interactive master menu
./setup.sh==================================================================
Fedora KDE & XMG M25 Setup Toolkit (Master Menu)
==================================================================
[Core Laptop & Hardware]
1) XMG M25 Drivers & TCC Patch (fedora-xmg-m25.sh)
2) Sleep & S2idle Battery Drain Fixes (apply_fixes.sh)
3) Install Keyboard Backlight Resume Hook (xmg-backlight-resume.sh)
[Applications & Workarounds]
4) DaVinci Resolve Studio Full Installer (fedora-resolve-installer.sh)
5) DaVinci Resolve GPU & KDE Titlebar Fix (fedora-resolve-fix.sh)
6) Transcode Video Audio (AAC β PCM) (prepare-for-resolve.sh)
7) Antigravity IDE Exit Crash Fixer (fedora-antigravity-fix.sh)
8) Affinity Extreme Zoom Freeze Fix (apply-affinity-zoom-fix.sh)
[Razer Peripherals (Optional)]
9) OpenRazer Mouse Dock Pro Driver (fedora-openrazer.sh)
10) Razer USB Autosuspend / PowerTOP Fix (fix-razer-autosuspend.sh)
[Automated Workflows]
G) Guided Setup Wizard (interactive step-by-step)
A) Apply Recommended Core Laptop Fixes (1 + 2)
Q) Quit
------------------------------------------------------------------
Beginner Tip: If you're not sure what you need, choose option
G(Guided Setup Wizard). It will ask you simple Yes/No questions and configure only what matches your hardware!
- Laptop Model: Schenker / XMG Pro 16 VE M25
- Operating System: Fedora 44 KDE (Linux 64-bit)
- Kernel:
7.0.x(tested on7.0.11and7.0.12) - Display Server: Wayland with KDE Plasma 6
- GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU + Intel Integrated Graphics (Hybrid PRIME)
- DaVinci Resolve Studio:
21.x(Linux)
If you are setting up a fresh Fedora installation, complete these 4 simple steps first. They ensure your graphics card and system libraries are ready.
Fedora needs the official NVIDIA proprietary drivers to use your dedicated graphics card:
# 1. Enable RPM Fusion repositories (Free & Non-Free)
sudo dnf install -y \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# 2. Install NVIDIA driver and CUDA compute support
sudo dnf install -y akmod-nvidia xorg-x11-drv-nvidia-cuda
# 3. Wait for the background compiler to finish (~2-3 minutes), then verify:
modinfo -F version nvidia
# If a version number appears (e.g. 570.xx), the driver is ready β reboot!
# If blank, wait 1 more minute and re-test before rebooting.
sudo rebootAfter rebooting, confirm NVIDIA is working:
nvidia-smiTo make sure KDE Plasma Wayland uses your NVIDIA card smoothly for display output:
sudo grubby --update-kernel=ALL --args="nvidia-drm.modeset=1"
sudo rebootAfter reboot, verify:
glxinfo | grep "OpenGL renderer"
# Should display your NVIDIA GeForce RTX GPU (not llvmpipe)TUXEDO Control Center lets you manage fan profiles, keyboard backlights, and power modes. Install it from the official TUXEDO repository:
# 1. Add TUXEDO repository
sudo dnf config-manager addrepo --from-repofile="https://rpm.tuxedocomputers.com/fedora/tuxedo.repo"
# 2. Import their security key
sudo rpm --import https://rpm.tuxedocomputers.com/fedora/43/0x54840598.pub.asc
# 3. Install the Control Center app
sudo dnf install -y tuxedo-control-centerNote: The RPM package installs default tuxedo drivers. Our toolkit (
fedora-xmg-m25.sh) will replace them with custom Schenker-whitelisted drivers so your XMG hardware is recognized.
Fedora excludes certain audio/video codecs out of the box due to licensing. Install them so web videos, media players, and video editors play smoothly:
# 1. Swap limited ffmpeg for full-featured ffmpeg
sudo dnf swap -y ffmpeg-free ffmpeg --allowerasing
# 2. Install multimedia plugins (H.264, H.265, AAC, etc.)
sudo dnf update -y @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin
sudo dnf group install -y sound-and-video
# 3. Enable hardware video decoding for Intel iGPU
sudo dnf swap -y mesa-va-drivers mesa-va-drivers-freeworld[Fresh Fedora Install]
β
βββ Step A: Install NVIDIA Drivers (RPM Fusion akmod-nvidia)
βββ Step B: Enable Wayland Modeset (nvidia-drm.modeset=1)
βββ Step C: Install TUXEDO Control Center (official repo)
βββ Step D: Install Full Media Codecs (ffmpeg & GStreamer)
β
βΌ [Reboot]
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ./setup.sh β
β (Interactive Master Control Menu) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββ [Option 1] fedora-xmg-m25.sh
β βββ Schenker DMI whitelist bypass
β βββ M25 TDP power limit tuning
β βββ Wayland / Electron crash patches for TCC
β
βββ [Option 2] apply_fixes.sh
β βββ Fixes S2idle battery drain during sleep
β βββ Enables NVIDIA S0ix dynamic power saving
β βββ Fixes Wayland lock-screen freeze (nvidia-drm.fbdev=1)
β
βββ [Option 3] xmg-backlight-resume.sh
β βββ Sleep hook to restore RGB backlight profiles on resume
β
βββ [Option 4 / 5] DaVinci Resolve Studio Tools
β βββ fedora-resolve-installer.sh (Automated 1-Click GUI Installer)
β βββ fedora-resolve-fix.sh (NVIDIA PRIME & KDE Titlebar Fixer)
β βββ resolve-launch.sh (Reference launch script)
β
βββ [Option 6] prepare-for-resolve.sh
β βββ Lossless AAC β PCM audio transcoder with Dolphin context menu
β
βββ [Option 7] fedora-antigravity-fix.sh
β βββ Replaces buggy @parcel/watcher node module to fix 90Β°C CPU exit spike
β
βββ [Option 8] apply-affinity-zoom-fix.sh
β βββ Patched Direct2D (recursion cap) & WineFix (5M% zoom lock) to fix Wine canvas freezes
β
βββ [Option 9 / 10] Razer Peripherals (Optional)
βββ fedora-openrazer.sh (Mouse Dock Pro relay driver with rollback)
βββ fix-razer-autosuspend.sh (Stops mouse & USB hub dropouts)
Every script can either be run through ./setup.sh or executed individually:
- What it does: Downloads official Tuxedo drivers and applies 4 critical source patches:
- Schenker DMI Whitelist: Allows the driver to recognize Schenker / XMG motherboard IDs (
X6PR5xxW_X6RP5xxW). - LED Collision Patch: Disables conflicting ACPI LED registrations that crash
tccdon newer Linux kernels. - M25 TDP Limits: Tunes power limit profiles specifically for the M25 chassis.
- GCC 14 Pointer Fix: Resolves strict pointer compilation errors on newer GCC toolchains.
- Schenker DMI Whitelist: Allows the driver to recognize Schenker / XMG motherboard IDs (
- Standalone Run:
sudo bash fedora-xmg-m25.sh
- The Problem: Modern Linux laptops use
s2idle(Modern Standby). Without proper tuning, NVIDIA GPUs and rogue ACPI devices keep waking up the CPU, draining your battery inside your backpack and causing the laptop to run hot while sleeping. - What it does:
- Configures NVIDIA Dynamic Power Management (
0x02) and S0ix sleep states. - Adds
nvidia-drm.fbdev=1to kernel parameters to prevent screen freezing on wake. - Overrides
SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=trueto prevent Wayland desktop hangs during sleep. - Creates an automated systemd service (
disable-acpi-wakeups.service) and sleep hook to disable rogue ACPI wakeup lines (PEG1,RP*), while preservingXHCIfor USB & Bluetooth keyboard/mouse wakeups. - Rebuilds initramfs with
dracut -fand updates SELinux contexts.
- Configures NVIDIA Dynamic Power Management (
- Standalone Run:
sudo bash apply_fixes.sh
- What it does: A systemd-sleep hook placed in
/usr/lib/systemd/system-sleep/that waits 5 seconds after waking from sleep, queries active user sessions, and re-applies custom RGB backlight profiles via Python. - Standalone Setup:
sudo cp xmg-backlight-resume.sh /usr/lib/systemd/system-sleep/ sudo chmod +x /usr/lib/systemd/system-sleep/xmg-backlight-resume.sh
- What it does:
- Shows an animated progress bar while extracting
DaVinci_Resolve_Studio_*_Linux.zip. - Automatically installs required legacy system dependencies (
libxcrypt-compat). - Runs Blackmagic's installer with
SKIP_PACKAGE_CHECK=1to bypass unsupported distro warnings. - Automatically runs
fedora-resolve-fix.shafter installation. - Cleans up the temporary
.runfile when finished.
- Shows an animated progress bar while extracting
- Requirements: Place the downloaded
DaVinci_Resolve_Studio_*_Linux.zipin the same directory. - Standalone Run:
bash fedora-resolve-installer.sh
- What it does:
- Fixes crashes on Fedora: Moves conflicting bundled system libraries (
libglib-2.0,libgio-2.0, etc.) to a disabled backup directory so Resolve uses Fedora's system libraries. - Configures NVIDIA PRIME: Ensures the desktop shortcuts and terminal launchers run Resolve on the discrete NVIDIA GPU.
- KDE Window Title Bar Rule: DaVinci Resolve requests borderless mode by default on KDE. This script automatically adds a KWin window rule to force standard title bars and minimize/maximize buttons.
- Fixes crashes on Fedora: Moves conflicting bundled system libraries (
- Standalone Run:
bash fedora-resolve-fix.sh
- The Problem: DaVinci Resolve on Linux has limited native support for AAC audio streams in MP4/MOV containers.
- What it does: Instantly remuxes audio from AAC to uncompressed 16-bit PCM (
pcm_s16le) while copying the video stream 100% untouched and losslessly (takes just seconds per gigabyte).- Supports
.mp4,.mov,.mkv,.m4v,.avi,.webm,.ts. - Outputs
${filename}_resolve.mov(original files are never modified or overwritten). - Integrates with KDE Dolphin context menus (right-click β Convert) and sends desktop notifications via
notify-send.
- Supports
- Standalone Run:
# Convert all videos in the current folder: ./prepare-for-resolve.sh # Or convert a specific folder or file: ./prepare-for-resolve.sh /path/to/videos
- The Problem: When zooming deeply or rapidly scrolling in Affinity Suite (Photo, Designer, Publisher) under Wine on Linux, Direct2D's bezier hit-testing (
d2d_point_on_bezier_segment/d2d_geometry_intersect_bezier_bezier) breaks down as transformed coordinates exceed float32 mantissa precision (2^23 β 8,388,608%). At this point, curve subdivision error estimates stop shrinking, leading to unbounded infinite recursion loops that completely freeze the CPU rendering thread and lock up the application. - What it does:
- Direct2D Recursion & Split Budget: Deploys a patched
d2d1.dllwith recursion depth caps and bezier split budgets so hit-testing never enters an infinite loop. - WineFix 5M% Zoom Lock: Deploys a patched
WineFix.dllplugin withMaxZoomLock(capped at 5,000,000% zoom) to guarantee coordinates stay safely within 32-bit floating point precision. - Startup Crash Prevention: Enables synchronous font enumeration in
winefix.tomlto prevent WPF typeface layout crashes on startup. - Automated Launcher: Updates
~/.local/share/applications/Affinity.desktopto run throughAffinityHook.exewith native Direct2D overrides (WINEDLLOVERRIDES="d2d1=n,b"). - Non-destructive Backups: Preserves original DLLs with
.bak-origextensions.
- Direct2D Recursion & Split Budget: Deploys a patched
- Standalone Run:
bash apply-affinity-zoom-fix.sh
- The Problem: Google Antigravity IDE bundles
@parcel/watcherv2.5.1, which has a known teardown race condition on Linux. When closing the IDE, it triggers a backgroundSIGSEGVcrash that causessystemd-coredumpto write multi-gigabyte coredumps to disk, pegging the CPU at 100% and spiking temperatures past 90Β°C. - What it does: Surgically replaces the buggy native Node module with stable
@parcel/watcherv2.5.6 from NPM, installs desktop shortcuts, and eliminates the exit crash entirely. - Standalone Run:
sudo bash fedora-antigravity-fix.sh
- What it does: For owners of the Razer Mouse Dock Pro and compatible wireless mice (Basilisk V3 Pro, Cobra Pro, Naga V2 Pro). Clones and installs the experimental PR #2817 branch with full mouse-to-dock pass-through relay support.
- Includes Rollback: Automatically creates backups and allows 1-command rollback:
# Install PR #2817 driver: bash fedora-openrazer.sh install # Restore official OpenRazer 3.12.4: bash fedora-openrazer.sh rollback
- What it does: Configures
/etc/udev/rules.d/99-usb-power.rulesto prevent Linux USB autosuspend from putting the Razer Basilisk V3 Pro (1532:00ab) or its internal USB hub (05e3:0610) to sleep, preventing mouse lag and disconnects. Also updatespowertop-tuning.serviceif present. - Standalone Run:
sudo bash fix-razer-autosuspend.sh
Because fedora-xmg-m25.sh and fedora-openrazer.sh install through DKMS (Dynamic Kernel Module Support), your drivers are automatically recompiled for new kernels in the background. You do not need to re-run the scripts after normal updates.
If tuxedo-drivers gets updated directly from the Tuxedo repository during a system upgrade, simply launch ./setup.sh and select option 1 (fedora-xmg-m25.sh). The script will re-apply the custom Schenker DMI patches cleanly.
Yes! Every script in this repository is completely independent. If you only want the DaVinci Resolve fix, simply run fedora-resolve-fix.sh. If you only want the Antigravity fix, run fedora-antigravity-fix.sh.
These scripts are provided in good faith to assist Linux laptop users. Always back up your important data.
Released under the GNU General Public License v3 (GPLv3). You are free to inspect, modify, and distribute this software under the same license terms.