.desktop file won’t launch Proton app on double-click (works in terminal)

I’m creating a custom Proton-based “Windows layer” (without Steam) to run .exe files directly on Linux.
Running them from terminal works fine — but double-clicking via a .desktop launcher does nothing.


🧩 Working terminal test

This command works perfectly — Proton starts and logs output:

xdg-open ~/Téléchargements/Bulletin de paie/guiformat.exe

Terminal output:

ProtonFixes[22570] WARN: Skipping fix execution. We are probably running an unit test.
fsync: up and running.

…but double-clicking the same .exe file in the file manager (associated via my .desktop entry) results in no visible action or log.


⚙️ Context

I’m trying to create a lightweight “Windows compatibility layer” using Proton GE without Steam.
The goal: let users double-click .exe files and have them launch automatically through Proton.


🗂 Folder structure setup

# Create Proton environment and Windows-like structure
sudo mkdir -p /Windows/Proton/{runners,fake-steam,system/pfx/dosdevices}
sudo mkdir -p /Windows/drive_c/{Program Files,Program Files (x86),Users}

# Give ownership to the current user
sudo chown -R $USER:$USER /Windows

# Link home directory to the fake Windows user
sudo ln -s /home/julien /Windows/drive_c/Users/julien

# Create AppData folders for compatibility
mkdir -p /Windows/drive_c/Users/julien/AppData/{Local,Roaming,Temp}

🧩 Proton GE installation

wget https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton10-22/GE-Proton10-22.tar.gz
tar -xvf GE-Proton10-22.tar.gz
rm GE-Proton10-22.tar.gz

🧠 Environment initialization

export STEAM_COMPAT_DATA_PATH=/Windows/Proton/system
export STEAM_COMPAT_CLIENT_INSTALL_PATH=/Windows/Proton/fake-steam

Tested and confirmed working:

/Windows/Proton/runners/GE-Proton10-22/proton run winecfg
# or
/Windows/Proton/runners/GE-Proton10-22/proton run wineboot -i

🪄 Custom winrun script

Located at /usr/local/bin/winrun

#!/bin/bash

# Proton GE runner and fake Steam environment
PROTON_RUNNER=/Windows/Proton/runners/GE-Proton10-22/proton
FAKE_STEAM=/Windows/Proton/fake-steam
PREFIX_DIR=/Windows/Proton/system

# Proton environment variables
export STEAM_COMPAT_DATA_PATH="$PREFIX_DIR"
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$FAKE_STEAM"

# Optional optimizations
export PROTON_NO_ESYNC=0
export PROTON_NO_FSYNC=0
export DXVK_ASYNC=1

# Run Proton with provided arguments
"$PROTON_RUNNER" run "$@"

Make it executable:

sudo chmod +x /usr/local/bin/winrun

🖥️ .desktop entry

Located at /usr/share/applications/winrun.desktop

[Desktop Entry]
Name=Windows Application
Comment=Launch Windows executables via Proton
# Use bash wrapper to pass proper session vars
Exec=bash -c 'export DISPLAY=${DISPLAY:-:0}; 
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}; 
export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0}; 
exec /usr/local/bin/winrun "$1"' _ %f
Type=Application
MimeType=application/x-ms-dos-executable;application/x-msdownload;
Icon=application-x-msdownload
Categories=Utility;
StartupNotify=true

🔗 MIME association setup

xdg-mime install --novendor /usr/share/applications/winrun.desktop
xdg-mime default winrun.desktop application/x-ms-dos-executable
xdg-mime default winrun.desktop application/x-msdownload

mkdir -p ~/.local/share/applications
cp /usr/share/applications/winrun.desktop ~/.local/share/applications/
chmod +x ~/.local/share/applications/winrun.desktop
update-desktop-database ~/.local/share/applications/
sudo update-desktop-database /usr/share/applications/

🧩 Problem

  • .exe files correctly show the Windows icon and open with Windows Application
  • The same command works in terminal ✅
  • Double-clicking does absolutely nothing ❌

💡 Possible causes (hypotheses)

  • The Exec placeholder (%f, %u, etc.) might not be handled correctly
  • $DISPLAY or $XDG_RUNTIME_DIR not being passed in GUI context
  • Proton might require a working directory context (e.g. %k path)
  • File manager might silently discard stderr/stdout (no visible log)

Question:
What’s the proper way to make a .desktop file launch a bash script (like winrun) with file arguments (%f) so Proton executes .exe files correctly on double-click?

Also: is there a way to debug or log what actually happens when the desktop entry runs (e.g. journalctl or systemd log paths)?


🧩 Update

a) No issue running winrun guiformat.exe; it opens fine.
I had to install some 32-bit Wine dependencies (test only).
Output:

ProtonFixes[64816] WARN: Skipping fix execution.
fsync: up and running.

b) First time making a .desktop — I usually work full CLI.
Made it more complex since with a hard-coded argument I only got terminal output via xdg-open, no window.
Now it opens from terminal but not from the GUI.
You were right about moving environment variables inside winrun; I had some .desktop issues, that may help.
I’ll test and share results if you’re interested.


Tried this version of winrun:

#!/bin/bash
PROTON_RUNNER=/Windows/Proton/runners/GE-Proton10-22/proton
FAKE_STEAM=/Windows/Proton/fake-steam
PREFIX_DIR=/Windows/Proton/system

export DISPLAY=${DISPLAY:-:0}
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
export STEAM_COMPAT_DATA_PATH="$PREFIX_DIR"
export STEAM_COMPAT_CLIENT_INSTALL_PATH="$FAKE_STEAM"
export PROTON_NO_ESYNC=0
export PROTON_NO_FSYNC=0
export DXVK_ASYNC=1

"$PROTON_RUNNER" run "$@"

Changed my .desktop file too, but same issue.

#[Desktop Entry]
Name=Windows Application
Comment=Run Windows executables via Proton
Exec=/usr/local/bin/winrun
Type=Application
MimeType=application/x-ms-dos-executable;application/x-msdownload;
Icon=application-x-msdownload
Categories=Utility;
StartupNotify=true

Latest behavior:
I deleted the %f variable — now it works when I use “Open With”,
but the problem persists when I double-click the .exe file.


👉 *I’m on X11, not Wayland. so i deleted export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0}


troubleshoot on journal ctl :

julien@julien-IdeaPad-Gaming-3-15ACH6:~$ journalctl --user -f
oct. 27 21:10:52 julien-IdeaPad-Gaming-3-15ACH6 gnome-shell[2946]: Can't update stage views actor unnamed [MetaWindowActorX11] is on because it needs an allocation.
oct. 27 21:10:52 julien-IdeaPad-Gaming-3-15ACH6 gnome-shell[2946]: Can't update stage views actor unnamed [MetaSurfaceActorX11] is on because it needs an allocation.
oct. 27 21:10:57 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7904]: [75B blob data]
oct. 27 21:10:57 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7904]: /home/julien/Téléchargements/guiformat.exe: 2: Syntax error: ")" unexpected
oct. 27 21:11:15 julien-IdeaPad-Gaming-3-15ACH6 dbus-daemon[2532]: [session uid=1000 pid=2532] Activating service name='org.gnome.Nautilus' requested by ':1.39' (uid=1000 pid=2946 comm="/usr/bin/gnome-shell" label="unconfined")
oct. 27 21:11:15 julien-IdeaPad-Gaming-3-15ACH6 nautilus[7931]: Connecting to org.freedesktop.Tracker3.Miner.Files
oct. 27 21:11:15 julien-IdeaPad-Gaming-3-15ACH6 dbus-daemon[2532]: [session uid=1000 pid=2532] Successfully activated service 'org.gnome.Nautilus'
oct. 27 21:11:15 julien-IdeaPad-Gaming-3-15ACH6 gnome-shell[2946]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2000004
oct. 27 21:11:21 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7971]: [75B blob data]
oct. 27 21:11:21 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7971]: /home/julien/Téléchargements/guiformat.exe: 2: Syntax error: ")" unexpected
oct. 27 21:12:25 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7982]: [75B blob data]
oct. 27 21:12:25 julien-IdeaPad-Gaming-3-15ACH6 guiformat.exe[7982]: /home/julien/Téléchargements/guiformat.exe: 2: Syntax error: ")" unexpected