diff options
Diffstat (limited to 'src-tauri/scripts')
| -rwxr-xr-x | src-tauri/scripts/fix-appimage.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src-tauri/scripts/fix-appimage.sh b/src-tauri/scripts/fix-appimage.sh new file mode 100755 index 0000000..6bb375b --- /dev/null +++ b/src-tauri/scripts/fix-appimage.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# fix AppImage for Wayland compatibility +# This script modifies the AppImage bundle created by Tauri to ensure compatibility with Wayland +# It specifically targets the GTK backend settings to avoid forcing X11 + +set -e + +echo "Fixing AppImage for Wayland compatibility..." + +# Tauri sets the APPIMAGE_BUNDLE_PATH environment variable during the build process +APPDIR_PATH="${APPIMAGE_BUNDLE_PATH:-}" + +if [ -z "$APPDIR_PATH" ]; then + echo "No AppImage bundle path found, skipping fix" + exit 0 +fi + +# Check for the presence of the GTK hook file +if [ -d "$APPDIR_PATH/apprun-hooks" ]; then + HOOK_FILE="$APPDIR_PATH/apprun-hooks/linuxdeploy-plugin-gtk.sh" + + if [ -f "$HOOK_FILE" ]; then + echo "Found GTK hook file, patching..." + + # Comment out the line that forces GDK_BACKEND to x11 + sed -i 's/^export GDK_BACKEND=x11.*$/# export GDK_BACKEND=x11 # Disabled for Wayland compatibility/' "$HOOK_FILE" + + echo "Successfully patched $HOOK_FILE" + fi +fi + +echo "AppImage Wayland fix completed!" |