goaaats / Dalamud.RichPresence

Discord Rich Presence for Dalamud
13 stars 19 forks source link

Suggestion: Linux support #21

Open tatsumara opened 1 year ago

tatsumara commented 1 year ago

Any chance to get this working on Linux?

sersorrel commented 1 year ago

you can use something like https://github.com/0e4ef622/wine-discord-ipc-bridge for this

XenHat commented 1 year ago

it needs a bit of handholding but I have a setup that works: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv-rpc-bridge

See comments below for the working script

ChibiChoko commented 1 year ago

it needs a bit of handholding but I have a setup that works: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv-rpc-bridge

How would one go about using this?

XenHat commented 1 year ago

it needs a bit of handholding but I have a setup that works: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv-rpc-bridge

How would one go about using this?

read the instructions included within. basically run it before or while running the game. it depends on wine-discord-IPC-bridge.

Lii-Kun commented 11 months ago

it needs a bit of handholding but I have a setup that works: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv-rpc-bridge

Since this was deleted, is there another way to get it working on linux

XenHat commented 10 months ago

it needs a bit of handholding but I have a setup that works: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv-rpc-bridge

Since this was deleted, is there another way to get it working on linux

Sorry, I've been doing lots of work on it. new file name: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/FinalFantasyXIVOnline

Edit: Fixed link to the correct script

Lii-Kun commented 10 months ago

Does it only work if you use the steam version? I bought the game prior to it going on steam so i can't use the steam version.

XenHat commented 10 months ago

Does it only work if you use the steam version? I bought the game prior to it going on steam so i can't use the steam version.

No, it works fine without steam

Lii-Kun commented 10 months ago

Does it only work if you use the steam version? I bought the game prior to it going on steam so i can't use the steam version.

No, it works fine without steam

OK, can i get some help on how to run the script? Also some help with installing the bridge correctly. I installed a version from the AUR but it doesn't seem to be installed in the locations your script is looking for it.

Ryonez commented 10 months ago

The script seems... I'm not really sure how it's meant to be working.

Adding it to FFXIV's launch commands, it only load the default launcher. The script has a bunch of stuff for the XIVLauncher, but doesn't launch it. There's no indication if it's running when starting the game through the XIVLauncher.

Running it manually while the game is running results in it finding the pid for the game... and printing that constantly.

I set up a little script I can run for now with manual values that'll work while the game is running:

#!/bin/bash
WINEPREFIX=~/.xlcore/wineprefix/ WINEESYNC=1 ~/.xlcore/unofficial-wine-xiv-Proton8-25-x86_64/bin/wine64 /opt/wine-discord-ipc-bridge/winediscordipcbridge.exe

Some things might need to be tweaked for others, I'm using a custom wine here for example. Made an alias pointing to the script for now, and run it when I load the game.

I think this could be integrated into the XIVLauncher itself without to much trouble and would help, as you can't pass things like mangohud in the launch commands. At least, I haven't figured it out yet it you can.

XenHat commented 10 months ago

Apologies, Not only did I link to the wrong script, I also had to fix a few things. I've confirmed it works now. I've edited the comment above with the correct url, but here it is again just in case:

https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/FinalFantasyXIVOnline

Usage: Run it. That's it.

How I use it: inside a .desktop file.

XenHat commented 10 months ago

OK, can i get some help on how to run the script? Also some help with installing the bridge correctly. I installed a version from the AUR but it doesn't seem to be installed in the locations your script is looking for it.

This is the correct package: https://aur.archlinux.org/packages/discord-rpc-wine-git See the comment above on how to run it.

2024/04/17 update: The correct AUR package is https://aur.archlinux.org/packages/wine-discord-ipc-bridge-git

I think this could be integrated into the XIVLauncher itself without to much trouble and would help, as you can't pass things like mangohud in the launch commands. At least, I haven't figured it out yet it you can.

Yes, ideally this should be integrated within XIVLauncher. I have to parse and apply the game's environment so that the bridge even works with the plugin, so if the launcher takes care of it, my script will no longer be needed.

Working Autorun tab when?

Lii-Kun commented 10 months ago

OK, can i get some help on how to run the script? Also some help with installing the bridge correctly. I installed a version from the AUR but it doesn't seem to be installed in the locations your script is looking for it.

This is the correct package: https://aur.archlinux.org/packages/discord-rpc-wine-git See the comment above on how to run it.

I think this could be integrated into the XIVLauncher itself without to much trouble and would help, as you can't pass things like mangohud in the launch commands. At least, I haven't figured it out yet it you can.

Yes, ideally this should be integrated within XIVLauncher. I have to parse and apply the game's environment so that the bridge even works with the plugin, so if the launcher takes care of it, my script will no longer be needed.

Working Autorun tab when?

Ok So I had the right Discord-rpc package. But running the script launches xivlauncher but no game info showing in discord.(yes I have the discord plugin from dalamud)

Ryonez commented 10 months ago

And I'm getting an SSL connection error when using the script. Also disabled the init it seemed to be doing nothing.

I don't mind helping with this, but I feel like we should make an issue on the repo for the script for script specific troubleshooting.

XenHat commented 10 months ago

And I'm getting an SSL connection error when using the script. ~Also disabled the init it seemed to be doing nothing.~

I don't mind helping with this, but I feel like we should make an issue on the repo for the script for script specific troubleshooting.

You might need to use the crypto workaround from the FAQ: https://goatcorp.github.io/faq/xl_troubleshooting#q-im-on-linux-and-i-keep-getting-xivlauncher-failed-to-update-errors.

Feel free to open an issue on my dot files repository. I probably won't be splitting the script off to a subrepo due to the seemingly temporary nature of this workaround.

Ryonez commented 10 months ago

It works correctly running the launcher without the script. I'm not seeing anything in the script to suggest it's changing that setting.

XenHat commented 10 months ago

My workaround is a hack at best, and it works for my two machines I use it on. One runs Nobara 39, the other Arch Linux.

The script comes with no warranty, no guarantee, and I wouldn't even know where to begin to fix a problem I can't reproduce. I only offered my script as a stopgap in the hope that it helps anyone else than me, but I am not turning it into a standalone project as I shouldn't be the one to implement this feature in the first place.

Sorry it's not working for you.

Ryonez commented 10 months ago

Hey, it's no problem. I can run the ipc thing myself, so I'm not at a complete loss or anything. If I do poke around and figure that out I'll know you know though.

XenHat commented 7 months ago

Update for anyone who is still watching this issue and still wants something that works: I've rewritten the majority of the script and it should now work more reliably.

I'll also re-write the header with better instructions in the following minutes.

XenHat commented 7 months ago

@Ryonez My apologies, the correct package is in fact https://aur.archlinux.org/packages/wine-discord-ipc-bridge-git. It is confusing.

XenHat commented 4 months ago

Until a fixed version lands, I've been working on my script and I have converted it to a systemd service for anyone still interested in this: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv_rpc_service. You can then launch the XIVLauncher normally without any wrapper and it should function as expected.

coldReactive commented 4 months ago

Until a fixed version lands, I've been working on my script and I have converted it to a systemd service for anyone still interested in this: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv_rpc_service. You can then launch the XIVLauncher normally without any wrapper and it should function as expected.

Service Example:

  1. Copy the contents of the above linked file on gitlab into ~/scripts/ffxiv_rpc
  2. Put the below code into ~/.config/systemd/user/ffxiv_rpc.service
    
    [Unit]
    Description=Discord Rich Presence Service for FFXIV

[Service] Type=simple ExecStart=%h/scripts/ffxiv_rpc

[Install] WantedBy=default.target


3. Enable it through `systemctl --user enable ffxiv_rpc` as explained per https://wiki.archlinux.org/title/Systemd/User

Thanks to the Arch Forums for giving me the proper service file syntax to reference the home directory as well: https://bbs.archlinux.org/viewtopic.php?id=297777#p2184333

***You should NOT run this service at a system level.***
femxiii commented 4 months ago
3. Enable it through `systemctl --user enable ffxiv_rpc` as explained per https://wiki.archlinux.org/title/Systemd/User

You can add --now to start the service too

coldReactive commented 4 months ago

XenHat provided a slightly better service configuration over at https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/systemd/ffxiv-rpc-glue.service

Which should exit when it detects itself no longer doing anything. It should go into the same place as before (and make sure to remove the old service file and use the new one), or just copy the code over.

UltraAziz commented 1 month ago

script doesn't work for me, running the .desktop file doesn't do anything, I kinda gave up on trying to make it work

XenHat commented 1 month ago

script doesn't work for me, running the .desktop file doesn't do anything, I kinda gave up on trying to make it work

If you're using XIVLauncher flatpak, that's normal. I'm trying to work on a solution for rich presence but it's being difficult. The game should launch, though.

UltraAziz commented 1 month ago

script doesn't work for me, running the .desktop file doesn't do anything, I kinda gave up on trying to make it work

If you're using XIVLauncher flatpak, that's normal. I'm trying to work on a solution for rich presence but it's being difficult. The game should launch, though.

I'm actually using the appimage, but I got the rich presence to work by changing the wine version, I have no idea why that worked but it did