Skip to content

Enable games running under wine to use Discord Rich Presence

License

Notifications You must be signed in to change notification settings

cynojien/wine-discord-ipc-bridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wine Discord IPC Bridge

This program enables other programs which are running under Wine to send Rich Presence data to a Linux Discord client.

This is simply a proof-of-concept, demonstrating that this is possible, the code itself is a mish-mash of copy-paste from Microsoft docs and linux-discord-rpc.dll.

The way it works is simply by bridging the gap between Windows named pipes (\\.\pipe\discord-ipc-0) and Unix domain sockets (/run/user/{userid}/discord-ipc-0). Ideally something like this would be implemented in wine itself, it should be possible to add some sort of "mapped named pipe" feature where wineserver will serve handles to unix sockets instead pseudo-handles to named pipes, but I don't know how to approach something like that.

Compiling

i686-w64-mingw32-gcc -masm=intel main.c -o winediscordipcbridge

Usage

Just run this program first, wait for it to start listening to the pipe, and then launch your program/game. The two programs need to be running under the same wineprefix. If you're using Steam Play/Proton, download and follow the instructions in winediscordipcbridge-steam.sh.

This program should automatically stop once the other program stops, although it'll keep running if nothing ever connects.

I've personally tested this with osu! on both 32-bit and 64-bit wineprefixes, and Muse Dash using the script to launch from Steam.

https://github.com/lhark/truckersmp-cli also reported success.

About

Enable games running under wine to use Discord Rich Presence

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 91.9%
  • Shell 7.2%
  • Makefile 0.9%