A C++20 rewrite of
0e4ef622/wine-discord-ipc-bridge.
This program lets applications running under Wine send Discord Rich Presence data to a Linux Discord client. It bridges the gap between the Windows named pipe (\\.\pipe\discord-ipc-0) that the Wine-side program connects to, and the host's Unix domain socket ($XDG_RUNTIME_DIR/discord-ipc-0) that the Linux Discord client listens on.
This is a C++20 rewrite — and a fork — of Matthew Tran's original C project, 0e4ef622/wine-discord-ipc-bridge. The bridging logic, the raw int 0x80 Linux syscall stubs, the named-pipe ⇄ socket plumbing, and the two-thread design are all carried over from the original.
What the rewrite changed:
- Built as C++20 (
i686-w64-mingw32-g++ -std=c++20) instead of C. - C++ standard headers (
<cstdio>,<cstring>,<cstdint>),constexprconstants,nullptr, C++ casts, and the standardint main()entry point. - One behavioural fix: the original printed the pipe name with a
%lsformat against a narrow string (a latent type mismatch that printed garbage); it is now%s.
What did not change: behaviour is intentionally identical to the original. The int 0x80 syscall stubs compile to byte-for-byte the same machine code.
Requirements: Linux, make, and a 32-bit MinGW-w64 GCC toolchain that provides i686-w64-mingw32-g++. The bridge is a 32-bit binary on purpose — the original's raw int 0x80 syscall ABI is i386-specific.
Install the toolchain for your distribution:
Debian / Ubuntu / Linux Mint / Pop!_OS
sudo apt install make mingw-w64Fedora
sudo dnf install make mingw32-gcc-c++RHEL / CentOS / Rocky / AlmaLinux — the MinGW packages come from EPEL:
sudo dnf install epel-release
sudo dnf install make mingw32-gcc-c++Arch / Manjaro / EndeavourOS
sudo pacman -S make mingw-w64-gccAlpine — the community repository must be enabled:
sudo apk add make i686-mingw-w64-gccNote
On any other distribution, install make and your distribution's 32-bit MinGW-w64 GCC package — whichever one provides i686-w64-mingw32-g++.
Then build:
makeThis produces winediscordipcbridge.exe.
Start the bridge first, wait for it to print that it is listening on the pipe, then launch your program or game. Both must run under the same Wine prefix.
run.sh is a Steam Play launch wrapper (this fork's equivalent of upstream's winediscordipcbridge-steam.sh). Set the game's Launch Options to:
/path/to/run.sh %command%
run.sh starts the bridge alongside the game (via PROTON_REMOTE_DEBUG_CMD) and makes the Discord IPC socket reachable inside the Proton pressure-vessel container. It looks for winediscordipcbridge.exe next to itself.
Important
Keep run.sh and winediscordipcbridge.exe at a plain-ASCII, space-free path. The path passes through several layers (Steam → the script → Proton's PROTON_REMOTE_DEBUG_CMD), and a space or non-ASCII character gets word-split somewhere in that chain — the bridge then fails to launch. If your real path has a space, point the launch option at a space-free symlink.
wine-discord-ipc-bridge/
├── main.cpp — the bridge (C++20 rewrite)
├── Makefile — build with `make`
├── run.sh — Steam Proton launch wrapper
├── LICENSE — MIT (original + rewrite copyright)
└── README.md — this file
0e4ef622/wine-discord-ipc-bridge— the original this is a rewrite of.EnderIce2/rpc-bridge— alternative implementation.openglfreak/winestreamproxy— alternative implementation.
MIT — see LICENSE.
This is a derivative work. The original copyright (© 2020 Matthew Tran) is retained as required by the MIT License; the C++20 rewrite adds its own copyright line.
Not affiliated with Discord Inc. or Valve.