Add docs
31
.github/workflows/mkdocs.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: mkdocs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Configure Git Credentials
|
||||||
|
run: |
|
||||||
|
git config user.name github-actions[bot]
|
||||||
|
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
key: mkdocs-material-${{ env.cache_id }}
|
||||||
|
path: .cache
|
||||||
|
restore-keys: |
|
||||||
|
mkdocs-material-
|
||||||
|
- run: pip install mkdocs-material
|
||||||
|
- run: mkdocs gh-deploy --force
|
105
README.md
@ -1,8 +1,8 @@
|
|||||||
# Discord RPC Bridge for Wine
|
# Discord RPC Bridge for Wine
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Simple bridge that allows you to use Discord Rich Presence with Wine games/software.
|
Simple bridge that allows you to use Discord Rich Presence with Wine games/software.
|
||||||
|
|
||||||
@ -12,96 +12,47 @@ This bridge takes advantage of the Windows service implementation in Wine, elimi
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Table of Contents
|
|
||||||
|
|
||||||
- [Discord RPC Bridge for Wine](#discord-rpc-bridge-for-wine)
|
|
||||||
- [Table of Contents](#table-of-contents)
|
|
||||||
- [Installation \& Usage](#installation--usage)
|
|
||||||
- [Installing inside a prefix](#installing-inside-a-prefix)
|
|
||||||
- [Wine (~/.wine)](#wine-wine)
|
|
||||||
- [Lutris](#lutris)
|
|
||||||
- [Steam](#steam)
|
|
||||||
- [If you use Flatpak](#if-you-use-flatpak)
|
|
||||||
- [Run without installing the service](#run-without-installing-the-service)
|
|
||||||
- [About macOS](#about-macos)
|
|
||||||
- [Compiling from source](#compiling-from-source)
|
|
||||||
- [Command line arguments](#command-line-arguments)
|
|
||||||
- [Debugging](#debugging)
|
|
||||||
- [Demo](#demo)
|
|
||||||
- [Credits](#credits)
|
|
||||||
|
|
||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
|
|
||||||
Installation will place `bridge.exe` to `C:\bridge.exe` (if it's not already there) and create a Windows service. This service will automatically start when the prefix is used.
|
Installation will copy itself to `C:\windows\bridge.exe` and create a Windows service.
|
||||||
|
Logs are stored in `C:\windows\logs\bridge.log`.
|
||||||
If you prefer not to use the service for any reason, please refer to the [Run without installing the service](#run-without-installing-the-service) section.
|
|
||||||
|
|
||||||
#### Installing inside a prefix
|
#### Installing inside a prefix
|
||||||
|
|
||||||
##### Wine (~/.wine)
|
##### Wine (~/.wine)
|
||||||
|
|
||||||
- Open terminal in `build`
|
- Double click `bridge.exe` and click `Install`.
|
||||||
- Run `$ wine cmd` and `C:\> install.bat`
|
- 
|
||||||
- 
|
- To remove, the same process can be followed, but click `Remove` instead.
|
||||||
- To remove, run `C:\> remove.bat`
|
|
||||||
- 
|
|
||||||
- Note: Copying files are not required here.
|
|
||||||
|
|
||||||
##### Lutris
|
##### Lutris
|
||||||
|
|
||||||
- Right click on the game and select `Browse files`
|
- Click on a game and select `Run EXE inside Wine prefix`.
|
||||||
- 
|
- 
|
||||||
- Copy contents of `build` to the game's prefix `drive_c`
|
- The same process can be followed as in Wine.
|
||||||
- 
|
|
||||||
- To install open the console
|
|
||||||
- 
|
|
||||||
- And run `C:\> install.bat` (make sure you are in `C:\`!)
|
|
||||||
- 
|
|
||||||
|
|
||||||
##### Steam
|
##### Steam
|
||||||
|
|
||||||
- Open [Protontricks](https://github.com/Matoking/protontricks) and select the game you want to install the bridge to
|
- Right click on the game and select `Properties`.
|
||||||
- Select `Select the default wineprefix`
|
- Under `Set Launch Options`, add the following:
|
||||||
- Select `Browse files` and copy contents of `build` to the game's prefix `drive_c`
|
- 
|
||||||
- Select `Run a Wine cmd shell` and run `C:\> install.bat`
|
- The `bridge.sh` script must be in the same directory as `bridge.exe`.
|
||||||
- If you are not in `C:\`, type `c:` and press enter
|
|
||||||
- 
|
|
||||||
|
|
||||||
#### If you use Flatpak
|
#### If you use Flatpak
|
||||||
|
|
||||||
- If you are running Steam, Lutris, etc. in a Flatpak, you will need to allow the bridge to access the `/run/user/1000/discord-ipc-0` file.
|
- If you are running Steam, Lutris, etc in a Flatpak, you will need to allow the bridge to access the `/run/user/1000/discord-ipc-0` file.
|
||||||
- ##### By using [Flatseal](https://flathub.org/apps/details/com.github.tchx84.Flatseal)
|
- ##### By using [Flatseal](https://flathub.org/apps/details/com.github.tchx84.Flatseal)
|
||||||
- Add `xdg-run/discord-ipc-0` under `Filesystems` category
|
- Add `xdg-run/discord-ipc-0` under `Filesystems` category
|
||||||
- 
|
- 
|
||||||
- ##### By using the terminal
|
- ##### By using the terminal
|
||||||
- Per application
|
- Per application
|
||||||
- `flatpak override --filesystem=xdg-run/discord-ipc-0 <flatpak app name>`
|
- `flatpak override --filesystem=xdg-run/discord-ipc-0 <flatpak app name>`
|
||||||
- Globally
|
- Globally
|
||||||
- `flatpak override --user --filesystem=xdg-run/discord-ipc-0`
|
- `flatpak override --user --filesystem=xdg-run/discord-ipc-0`
|
||||||
|
|
||||||
## Run without installing the service
|
## macOS
|
||||||
|
|
||||||
If you prefer not to use the service, you can manually run `bridge.exe` within the Wine prefix.
|
On macOS, follow [these instructions](https://enderice2.github.io/rpc-bridge/installation.html#macos).
|
||||||
This method is compatible with both Wine and Lutris.
|
|
||||||
|
|
||||||
In Lutris, you can achieve this by adding the path to `bridge.exe` in the `Executable` field under `Game options`. In `Arguments` field, be sure to include the _Windows_ path to the game's executable.
|
|
||||||
Example:
|
|
||||||
- Without bridge:
|
|
||||||
- Executable `/mnt/games/lutris/league-of-legends/drive_c/Riot Games/League of Legends/LeagueClient.exe`
|
|
||||||
- Arguments `--locale=en_US --launch-product=league_of_legends --launch-patchline=live`
|
|
||||||
- With bridge:
|
|
||||||
- Executable `/mnt/games/lutris/league-of-legends/drive_c/bridge.exe`
|
|
||||||
- Arguments `"C:\Riot Games\League of Legends\LeagueClient.exe" --locale=en_US --launch-product=league_of_legends --launch-patchline=live`
|
|
||||||
|
|
||||||
In Wine, all you need to do is run `bridge.exe`.
|
|
||||||
|
|
||||||
- When running the program manually without providing any arguments, it will simply initiate the bridge and wait indefinitely until it's closed.
|
|
||||||
|
|
||||||
## About macOS
|
|
||||||
|
|
||||||
The bridge works similarly on macOS as it does on Linux, but it can't be registered as a service due to TMPDIR limitations. macOS users must manually run `bridge.exe` when needed.
|
|
||||||
|
|
||||||
To run `bridge.exe` on macOS, navigate to its directory in the terminal and execute `wine bridge.exe`. (or double click it in the Finder)
|
|
||||||
|
|
||||||
## Compiling from source
|
## Compiling from source
|
||||||
|
|
||||||
@ -109,24 +60,6 @@ To run `bridge.exe` on macOS, navigate to its directory in the terminal and exec
|
|||||||
- Open a terminal in the directory that contains this file and run `make`.
|
- Open a terminal in the directory that contains this file and run `make`.
|
||||||
- The compiled executable will be located in `build/bridge.exe`.
|
- The compiled executable will be located in `build/bridge.exe`.
|
||||||
|
|
||||||
## Command line arguments
|
|
||||||
|
|
||||||
- `--install` - Installs the service
|
|
||||||
- `--remove` - Removes the service
|
|
||||||
- `--service` - Reserved for the service
|
|
||||||
- `[Target Executable]` - Starts the bridge and the game
|
|
||||||
- Example: `bridge.exe "C:\Riot Games\League of Legends\LeagueClient.exe" --locale=en_US --launch-product=league_of_legends --launch-patchline=live`
|
|
||||||
- Note: The game executable must be enclosed in quotes. The rest of the arguments are passed to the target executable.
|
|
||||||
|
|
||||||
## Debugging
|
|
||||||
|
|
||||||
The bridge will write the logs in `C:\bridge.log`.
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
This project is inspired by [wine-discord-ipc-bridge](https://github.com/0e4ef622/wine-discord-ipc-bridge).
|
This project is inspired by [wine-discord-ipc-bridge](https://github.com/0e4ef622/wine-discord-ipc-bridge).
|
||||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
docs/assets/gui.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
docs/assets/lutris.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 203 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
BIN
docs/assets/steam_script.png
Normal file
After Width: | Height: | Size: 28 KiB |
33
docs/index.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Discord RPC Bridge for Wine
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
Simple bridge that allows you to use Discord Rich Presence with Wine games/software on Linux/macOS.
|
||||||
|
|
||||||
|
[Download latest release](https://github.com/EnderIce2/rpc-bridge/releases/latest/download/bridge.zip "Recommended"){ .md-button .md-button--primary }
|
||||||
|
[Download latest pre-release](https://github.com/EnderIce2/rpc-bridge/releases "Unstable builds with experimental features"){ .md-button }
|
||||||
|
<!-- [Download latest build](https://github.com/EnderIce2/rpc-bridge/actions "Builds from the latest commits, here be dragons!"){ .md-button } -->
|
||||||
|
|
||||||
|
Works by running a small program in the background that creates a [named pipe](https://learn.microsoft.com/en-us/windows/win32/ipc/named-pipes) `\\.\pipe\discord-ipc-0` inside the prefix and forwards all data to the pipe `/run/user/1000/discord-ipc-0`.
|
||||||
|
|
||||||
|
This bridge takes advantage of the Windows service implementation in Wine, eliminating the need to run it manually.
|
||||||
|
|
||||||
|
These docs are for the latest stable release.
|
||||||
|
For v1.0, see [the original README](https://github.com/EnderIce2/rpc-bridge/blob/v1.0/README.md).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
{ width="600" }
|
||||||
|
|
||||||
|
{ width="600" }
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
|
This project is inspired by [wine-discord-ipc-bridge](https://github.com/0e4ef622/wine-discord-ipc-bridge).
|
||||||
|
|
||||||
|
---
|
109
docs/installation.md
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
# Installation
|
||||||
|
|
||||||
|
Installation will copy itself to `C:\windows\bridge.exe` and create a Windows service.
|
||||||
|
Logs are stored in `C:\windows\logs\bridge.log`.
|
||||||
|
|
||||||
|
## Installing inside a prefix
|
||||||
|
|
||||||
|
### Wine (~/.wine)
|
||||||
|
|
||||||
|
- Double click `bridge.exe` and click `Install`.
|
||||||
|
- 
|
||||||
|
- To remove, the same process can be followed, but click `Remove` instead.
|
||||||
|
|
||||||
|
### Lutris
|
||||||
|
|
||||||
|
- Click on a game and select `Run EXE inside Wine prefix`.
|
||||||
|
- 
|
||||||
|
- The same process can be followed as in Wine.
|
||||||
|
|
||||||
|
### Steam
|
||||||
|
|
||||||
|
There are two ways to install the bridge on Steam.
|
||||||
|
|
||||||
|
#### Using bridge.sh[^1]
|
||||||
|
|
||||||
|
This method is recommended because it's easier to manage.
|
||||||
|
|
||||||
|
- Right click on the game and select `Properties`.
|
||||||
|
- Under `Set Launch Options`, add the following:
|
||||||
|
- 
|
||||||
|
<sup><sub>Of course, you need to replace `/path/to/bridge.sh` with the actual path to the script.</sub></sup>
|
||||||
|
|
||||||
|
!!! info "Note"
|
||||||
|
|
||||||
|
`bridge.sh` must be in the same directory as `bridge.exe`.
|
||||||
|
|
||||||
|
#### Using Protontricks
|
||||||
|
|
||||||
|
- Open [Protontricks](https://github.com/Matoking/protontricks) and select the game you want to install the bridge to.
|
||||||
|
- Select `Select the default wineprefix`
|
||||||
|
- Select `Browse files` and copy contents of `build` to the game's prefix `drive_c`
|
||||||
|
- Select `Run a Wine cmd shell` and run `C:\> install.bat`
|
||||||
|
- If you are not in `C:\`, type `c:` and press enter
|
||||||
|
|
||||||
|
, use it instead!")
|
||||||
|
|
||||||
|
!!! warning "If you use Flatpak"
|
||||||
|
|
||||||
|
If you are running Steam, Lutris, etc in a Flatpak, you will need to allow the bridge to access the `/run/user/1000/discord-ipc-0` file.
|
||||||
|
|
||||||
|
You can do this by using [Flatseal](https://flathub.org/apps/details/com.github.tchx84.Flatseal) or the terminal.
|
||||||
|
|
||||||
|
=== "Flatseal"
|
||||||
|
|
||||||
|
Add `xdg-run/discord-ipc-0` under `Filesystems` category
|
||||||
|

|
||||||
|
|
||||||
|
=== "Terminal"
|
||||||
|
|
||||||
|
- Per application
|
||||||
|
- `flatpak override --filesystem=xdg-run/discord-ipc-0 <flatpak app name>`
|
||||||
|
- Globally
|
||||||
|
- `flatpak override --user --filesystem=xdg-run/discord-ipc-0`
|
||||||
|
|
||||||
|
## macOS
|
||||||
|
|
||||||
|
If using the default Wine prefix (`~/.wine`), you can follow the same steps as in Wine.
|
||||||
|
|
||||||
|
Registering as a service [is not supported](https://github.com/EnderIce2/rpc-bridge/issues/1#issuecomment-2103423242 "Bridge can't get $TMPDIR unless is set with --rpc. See note below").
|
||||||
|
|
||||||
|
!!! info "Note"
|
||||||
|
|
||||||
|
Since macOS doesn't have `/proc/self/environ` and `$TMPDIR` is neither always set nor the same after reboots, so you will need to [add `--rpc "$TMPDIR"` to the `bridge.exe` arguments](https://github.com/EnderIce2/rpc-bridge/issues/1#issuecomment-2104797235).
|
||||||
|
If you don't encounter any issues, you can ignore this step.
|
||||||
|
|
||||||
|
## Run without installing the service
|
||||||
|
|
||||||
|
If you prefer not to use the service, you can manually run `bridge.exe` within the Wine prefix.
|
||||||
|
This method is compatible with both Wine and Lutris.
|
||||||
|
|
||||||
|
In Lutris, you can achieve this by adding the path to `bridge.exe` in the `Executable` field under `Game options`. In `Arguments` field, be sure to include the _Windows_ path to the game's executable.
|
||||||
|
|
||||||
|
=== "Without bridge"
|
||||||
|
|
||||||
|
```
|
||||||
|
Executable
|
||||||
|
/mnt/games/lutris/league-of-legends/drive_c/Riot Games/League of Legends/LeagueClient.exe
|
||||||
|
Arguments
|
||||||
|
--locale=en_US --launch-product=league_of_legends --launch-patchline=live
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "With bridge"
|
||||||
|
|
||||||
|
```
|
||||||
|
Executable
|
||||||
|
/mnt/games/lutris/league-of-legends/drive_c/bridge.exe
|
||||||
|
Arguments
|
||||||
|
"C:\Riot Games\League of Legends\LeagueClient.exe" --locale=en_US --launch-product=league_of_legends --launch-patchline=live
|
||||||
|
```
|
||||||
|
|
||||||
|
In Wine, all you need to do is run `bridge.exe` and select `Start`.
|
||||||
|
|
||||||
|
## Compiling from source
|
||||||
|
|
||||||
|
- Install the `wine`, `x86_64-w64-mingw32-gcc` and `make` packages.
|
||||||
|
- Open a terminal in the directory that contains this file and run `make`.
|
||||||
|
- The compiled executable will be located in `build/bridge.exe`.
|
||||||
|
|
||||||
|
[^1]: As requested [here](https://github.com/EnderIce2/rpc-bridge/issues/2).
|
32
docs/usage.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Usage
|
||||||
|
|
||||||
|
## GUI
|
||||||
|
|
||||||
|
- When running the program manually without providing any arguments it will show a GUI.
|
||||||
|

|
||||||
|
- `Start` will start the service without installing itself.
|
||||||
|
- `Install` will install the service.
|
||||||
|
- `Remove` will uninstall the service.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
- `--help` Show help message
|
||||||
|
- This will show the help message
|
||||||
|
|
||||||
|
- `--install` Install the service
|
||||||
|
- This will copy the binary to `C:\windows\bridge.exe` and register it as a service
|
||||||
|
|
||||||
|
- `--uninstall` Uninstall the service
|
||||||
|
- This will remove the service and delete `C:\windows\bridge.exe`
|
||||||
|
|
||||||
|
- `--steam` Reserved for Steam
|
||||||
|
- This will start the service and exit (used with `bridge.sh`)
|
||||||
|
|
||||||
|
- `--no-service` Do not run as service
|
||||||
|
- (only for `--steam`)
|
||||||
|
|
||||||
|
- `--service` Reserved for service
|
||||||
|
- Reserved
|
||||||
|
|
||||||
|
- `--rpc <dir>` Set RPC_PATH environment variable
|
||||||
|
- This is used to specify the directory where `discord-ipc-0` is located
|
Before Width: | Height: | Size: 321 KiB |
Before Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 609 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 541 KiB |
Before Width: | Height: | Size: 193 KiB |
75
mkdocs.yml
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
site_name: rpc-bridge
|
||||||
|
repo_url: https://github.com/EnderIce2/rpc-bridge
|
||||||
|
repo_name: EnderIce2/rpc-bridge
|
||||||
|
theme:
|
||||||
|
name: material
|
||||||
|
features:
|
||||||
|
- content.code.copy
|
||||||
|
- content.tabs.link
|
||||||
|
- navigation.tabs
|
||||||
|
- navigation.top
|
||||||
|
- navigation.footer
|
||||||
|
- toc.integrate
|
||||||
|
- content.tooltips
|
||||||
|
palette:
|
||||||
|
- media: "(prefers-color-scheme)"
|
||||||
|
toggle:
|
||||||
|
icon: material/weather-sunny
|
||||||
|
name: Switch to light mode
|
||||||
|
- media: "(prefers-color-scheme: dark)"
|
||||||
|
scheme: slate
|
||||||
|
primary: black
|
||||||
|
accent: indigo
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-4
|
||||||
|
name: Switch to system preference
|
||||||
|
- media: "(prefers-color-scheme: light)"
|
||||||
|
scheme: default
|
||||||
|
primary: indigo
|
||||||
|
accent: indigo
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-7
|
||||||
|
name: Switch to dark mode
|
||||||
|
font:
|
||||||
|
text: Roboto
|
||||||
|
code: Roboto Mono
|
||||||
|
favicon: assets/favicon.png
|
||||||
|
icon:
|
||||||
|
logo: logo
|
||||||
|
admonition:
|
||||||
|
note: octicons/tag-16
|
||||||
|
abstract: octicons/checklist-16
|
||||||
|
info: octicons/info-16
|
||||||
|
tip: octicons/squirrel-16
|
||||||
|
success: octicons/check-16
|
||||||
|
question: octicons/question-16
|
||||||
|
warning: octicons/alert-16
|
||||||
|
failure: octicons/x-circle-16
|
||||||
|
danger: octicons/zap-16
|
||||||
|
bug: octicons/bug-16
|
||||||
|
example: octicons/beaker-16
|
||||||
|
quote: octicons/quote-16
|
||||||
|
markdown_extensions:
|
||||||
|
- pymdownx.highlight:
|
||||||
|
anchor_linenums: true
|
||||||
|
line_spans: __span
|
||||||
|
pygments_lang_class: true
|
||||||
|
- admonition
|
||||||
|
- pymdownx.details
|
||||||
|
- pymdownx.inlinehilite
|
||||||
|
- pymdownx.snippets
|
||||||
|
- footnotes
|
||||||
|
- attr_list
|
||||||
|
- pymdownx.critic
|
||||||
|
- pymdownx.caret
|
||||||
|
- pymdownx.keys
|
||||||
|
- pymdownx.mark
|
||||||
|
- pymdownx.tilde
|
||||||
|
- pymdownx.tabbed:
|
||||||
|
alternate_style: true
|
||||||
|
plugins:
|
||||||
|
- offline
|
||||||
|
nav:
|
||||||
|
- Home: index.md
|
||||||
|
- Installation: installation.md
|
||||||
|
- Usage: usage.md
|