goatcorp / XIVLauncher.Core

Cross-platform version of XIVLauncher, optimized for Steam Deck
GNU General Public License v3.0
125 stars 42 forks source link

[Feature] Auto-Launch Wine Application With FFXIV In Prefix #74

Open viscountexx opened 12 months ago

viscountexx commented 12 months ago

I currently use the Wine Explorer to launch an application every time I start FFXIV. I could probably find exactly how to set up a script to run what I need (https://github.com/0e4ef622/wine-discord-ipc-bridge/ specifically, for the Discord Rich Presence plugin to work on Linux), but it would be really nice to be able to set certain applications to run in Wine whenever I run FFXIV via the launcher, and I'm sure there's all sorts of other power user gremlins who'd also love this.

Definitely not some high priority need, of course.

NotNite commented 12 months ago

We already have (had? dunno if we kept it) a similar system inside of the Windows launcher, so this likely isn't very difficult.

sersorrel commented 12 months ago

agreed that this would be useful - but for wine-discord-ipc-bridge in particular, you can avoid having to start it manually by using https://github.com/0e4ef622/wine-discord-ipc-bridge/pull/33

viscountexx commented 12 months ago

agreed that this would be useful - but for wine-discord-ipc-bridge in particular, you can avoid having to start it manually by using 0e4ef622/wine-discord-ipc-bridge#33

Oh, this looks amazingly helpful, thank you!

reiichi001 commented 12 months ago

The Linux channel on our discord also has a script you can use to start other addons without having to do it fofrom wine explorer. (I'd copy it, but it's a pain on mobile to fix formatting)

https://discord.com/channels/581875019861328007/850387047927250944/1019925861111181353

There is also https://github.com/goatcorp/XIVLauncher.Core/pull/31 which is still under review.

coldReactive commented 1 month ago

agreed that this would be useful - but for wine-discord-ipc-bridge in particular, you can avoid having to start it manually by using 0e4ef622/wine-discord-ipc-bridge#33

There is, alternatively, a user systemd approach to this. Using XenHat's Service Script: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv_rpc_service and installing the ipc bridge as per normal.

  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.***

If you want the service to run immediately alongside enabling it above in step 3, add `--now` option to the command.
viscountexx commented 1 month ago

agreed that this would be useful - but for wine-discord-ipc-bridge in particular, you can avoid having to start it manually by using 0e4ef622/wine-discord-ipc-bridge#33

There is, alternatively, a user systemd approach to this. Using XenHat's Service Script: https://gitlab.com/XenHat/dotfiles/-/blob/main/snowblocks/scripts/scripts/ffxiv_rpc_service and installing the ipc bridge as per normal.

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.

Holy shit, that's amazing! I'll turn this into a nix home-manager config very soon (and probably share it here in case anyone wants it), thank you so much!

coldReactive commented 1 month 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.