Skip to content
 
 

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wine-discord-ipc-bridge

A C++20 rewrite of 0e4ef622/wine-discord-ipc-bridge.

Platform Architecture License

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.

Relationship to the original

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>), constexpr constants, nullptr, C++ casts, and the standard int main() entry point.
  • One behavioural fix: the original printed the pipe name with a %ls format 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.

Building

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-w64

Fedora

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-gcc

Alpine — the community repository must be enabled:

sudo apk add make i686-mingw-w64-gcc

Note

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:

make

This produces winediscordipcbridge.exe.

Usage (Wine)

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.

Usage (Steam Proton)

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.

What's in this repository

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

Related projects

License

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.

About

C++20 rewrite of wine-discord-ipc-bridge — bridges Discord Rich Presence from Wine/Proton to a Linux Discord client

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages