Skip to content

Instantly share code, notes, and snippets.

@DPS0340
Last active October 5, 2023 00:34
Show Gist options
  • Select an option

  • Save DPS0340/0537596c53f90f310b6b400ae3dbad68 to your computer and use it in GitHub Desktop.

Select an option

Save DPS0340/0537596c53f90f310b6b400ae3dbad68 to your computer and use it in GitHub Desktop.

Revisions

  1. DPS0340 revised this gist Dec 22, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion prerequisites.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ sudo pacman -S socat

    ## Usage

    Run init script only once per session, using sudo.
    Run init script only once per session.

    ```bash
    sudo ./init-discord-rpc.sh
  2. DPS0340 revised this gist Dec 22, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion prerequisites.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ sudo pacman -S socat

    ## Usage

    Run init script only once using sudo.
    Run init script only once per session, using sudo.

    ```bash
    sudo ./init-discord-rpc.sh
  3. DPS0340 revised this gist Dec 22, 2022. No changes.
  4. DPS0340 created this gist Dec 22, 2022.
    17 changes: 17 additions & 0 deletions init-discord-rpc.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash

    set -x

    if pgrep -x "socat"
    then
    exit 1
    fi

    pkill socat
    rm -f /var/run/discord-ipc-0

    socat UNIX-LISTEN:/var/run/discord-ipc-0,fork \
    EXEC:"npiperelay.exe //./pipe/discord-ipc-0" &

    sleep 2
    chmod 777 /var/run/discord-ipc-0
    24 changes: 24 additions & 0 deletions prerequisites.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    ## PowerShell

    ```pwsh
    scoop bucket add extras
    scoop install npiperelay
    ```

    ## WSL 2

    Install [presence.nvim](https://github.com/andweeb/presence.nvim).

    Install socat.

    ```bash
    sudo pacman -S socat
    ```

    ## Usage

    Run init script only once using sudo.

    ```bash
    sudo ./init-discord-rpc.sh
    ```