rockerbacon/modorganizer2-linux-installer

NXM downloads don't work with Flatpaks

GamzeeRakoon opened this issue ยท 26 comments

When trying to download mods via NXM links on nexus MO2 will give me the error "failed to start download".
i have tested this on a fresh install of SkyrimSE/AE.

It is not MO2 that gives you the error but modorganizer2-linux-installer (kind of). If you are running flatpak version of protontricks, try switching to pipx version. It helped me.

I had same problem (or rather symptom) as you. In my case it was caused by "modorganizer2-nxm-broker.sh" script calling protontricks-launch, which is not a part of flatpak version and therefore was not on my system. I tried to rewrite the script myself to get it working with flatpak version of protontricks, but I was defeated by flatpak's handling of encapsulation.

I recognized my failure, installed protontricks via pipx and let my hatred towards flatpaks/snaps grow stronger.

Your fix worked like a charm, thanks man. I was at my wit's end.

Uninstalling the protontricks flatpak, removing the alias line from my .bashrc, and installing via pipx worked perfectly.

I seem to get similar problem after I updated protontricks, however it works if you hit the download button when MO2 is not running, then it starts up and the download is working, but if I try to download something more I i'm getting an en error, have tried to re-install MO2, but hasn't helped.

Probably related:
Matoking/protontricks#146

Installing protontricks-git fixed the issue for me

Same issue, installing protontricks-git from AUR fixed it for me too

I'll improve the readme to include better instructions for Flatpak users as soon as I can.

Perhaps the system requirement checks can also be improved to warn users of potential incompatibilities.

pipx works for me too, but I have same problem as @Osced86 , I can't download with MO2 from Nexus if it's open already, unlucky Linux still such mess

@kylecarow
What's alias line from .bashrc?

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.

If that feature is important for you, don't use Flatpaks.

So is there a way to have adequate Linux setup for gaming? For example Fallout: New Vegas and MO2 with working links all the time, can we have setup with auto updates or it's cringe for Linux devs to create something that fully working?

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.

If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This works perfectly for New Vegas as well.
Leaving some note for any users that want to use @Martan404's solution with New Vegas (or any other supported game):

  1. You'll need to know where you installed ModOrganizer for the current game, and replace that in the .desktop file. I installed mine in: $HOME/Games/mod-organizer-2-newvegas/.
  2. Now replace "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" with your folder. e.g. "$HOME/Games/mod-organizer-2-newvegas/modorganizer2/nxmhandler.exe"
  3. You can find the steam app id of the game in $HOME/Games/mod-organizer-2-newvegas/appid.txt. New Vegas is 22380
  4. You need to replace "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" with the id of the previous step. e.g.: "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/22380"

As a question for proton-knowledgable users. Isn't MO2 using proton 8.0 now? @Martan404's .desktop file is using 6.3.

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.

https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5

Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games.
My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.

Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.

EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This is very nice and works. Thank you very much. I have only had to change the proton path to 8.0 there, because that's what I use for Skyrim.

Now if someone could please explain to me, how do I install "protontricks-git" "from AUR"? or whatever protontricks that is not a flatpack? Google leads me to here: https://aur.archlinux.org/packages/protontricks-git, but how do I install that?

I tried sudo pacman -S protontricks-git but that didn't work: error: target not found: protontricks-git

(Just in case it's not clear, I'm on Steam Deck)

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This is very nice and works. Thank you very much. I have only had to change the proton path to 8.0 there, because that's what I use for Skyrim.

Now if someone could please explain to me, how do I install "protontricks-git" "from AUR"? or whatever protontricks that is not a flatpack? Google leads me to here: https://aur.archlinux.org/packages/protontricks-git, but how do I install that?

I tried sudo pacman -S protontricks-git but that didn't work: error: target not found: protontricks-git

(Just in case it's not clear, I'm on Steam Deck)

Unfortunately there is no easy and reliable way to install AUR packages on to the Steam Deck. If you want to install system packages you need to enter the command steamos-readonly disable. This will allow you to install pacman packages. ( I do not recommend doing this as it will reset after every SteamOS update).
Once that is done you need to install YAY or PARU to handle AUR packages. After installing YAY or PARU then you can then install protontricks using yay -S protontricks-git or paru -S protontricks-git

But why can you not use the flatpak version of Protontricks? If the flatpak is not working then try to exit the Steam client fully before opening Protontricks

Edit: On my desktop Arch system I prefer to use paru and this is how I install it

pacman -S git rust cmake 
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si

Desktop entry helped to resolve the issue, it raises the question why the system didn't generate it in that format from the beginning...

@StellarHarbour The way it usually sets it up allows for managing multiple games automatically. I don't think that version can, it's set to a single game.

@andersmmg Are you saying it can't be improved to work with every game?

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.

https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5

Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games. My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.

Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.

EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

Hey there, First of all thanks for trying to help all of us :)
Unfortunately, I tried this solution and could not get it to work. I am on Fedora 40 if that helps.
As mentioned by other people, the first download (before MO2 is launched) works, but then all further downloads are just ignored.

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.
https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5
Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games. My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.
Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.
EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

Hey there, First of all thanks for trying to help all of us :) Unfortunately, I tried this solution and could not get it to work. I am on Fedora 40 if that helps. As mentioned by other people, the first download (before MO2 is launched) works, but then all further downloads are just ignored.

Sorry, I just got the time to reply. Was there any error pop-up, or was it a silent error? I found an error caused by executing MO2 directly instead of using the forwarder, so I wanted to make sure about your execution condition.

Sorry, I just got the time to reply. Was there any error pop-up, or was it a silent error? I found an error caused by executing MO2 directly instead of using the forwarder, so I wanted to make sure about your execution condition.

Hi and thanks for the reply, it is a fully silent error. I tried launching it through steam, and also by using a nexus mod link (Which launches it and does the first download but not others)

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This works great, it seems the issue is mostly one of paths included in this .desktop file.

Mine is as follows for fallout 4, for future google travelers:

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/SR/.var/app/com.valvesoftware.Steam/.local/share/Steam" "STEAM_COMPAT_DATA_PATH=/blaze/SteamLibrary/steamapps/compatdata/377160" "/home/SR/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d/GE-Proton8-32/proton" run "/home/SR/Games/mod-organizer-2-fallout4/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;