返回

如何使用桌面条目链接处理程序让 Vortex 正常处理 nxm 链接?

Linux

使用桌面条目链接处理程序让 Vortex nxm 链接正常工作

简介

Vortex 是一款流行的模组管理器,用于管理 Bethesda 游戏引擎的游戏。但是,默认情况下,它无法处理 Nexus Mods 网站上的 nxm 链接(“模组管理器下载”链接)。本指南将提供一步一步的说明,指导您使用桌面条目链接处理程序解决此问题,从而让 Vortex 能够正常处理 nxm 链接。

问题概述

Vortex 安装程序附带一个 .sh 脚本,该脚本创建了一个 .desktop 文件,将 nxm 链接绑定为 Vortex 的默认处理程序。但是,这个 .desktop 文件存在问题,导致 Vortex 无法正常处理 nxm 链接。

解决方案

1. 编辑 .desktop 文件

打开 ~/.local/share/applications/vortex-downloads-handler.desktop 文件并进行以下更改:

  • 删除 Exec 行中的所有不必要的反斜杠。
  • CONFIGPATH= ... 1;\\") 替换为 CONFIGPATH=$(sqlite3 ~/.local/share/lutris/pga.db "select configpath from games where installer_slug = \"vortex-mod-manager-wine\" order by id asc limit 1;")
  • env ... 1;\\")" 替换为 env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/$(sqlite3 ~/.local/share/lutris/pga.db "select id from games where installer_slug = \"vortex-mod-manager-wine\" order by id asc limit 1;")
  • sed 行替换为以下内容:
sed -i "s/^  args:.*$/  args: -d $(printf \"%%s\\\\\\\\n\" \"%u\" | sed \"s/^'//;s/'$//;s/\\//\\\\\\\\\\\\\\\\\\\\\\\\//g;s/\\\\\\\\&/\\\\\\\\\\&/g\")/" "/home/doggy/.config/lutris/games/$CONFIGPATH.yml"

2. 将 Vortex 添加到 Lutris

确保 Vortex 已添加到 Lutris:

  • 启动 Lutris。
  • 点击“添加游戏”按钮。
  • 在“安装程序”选项卡中,选择“Wine”作为安装程序类型。
  • 在“安装程序路径”字段中,输入 Vortex 的安装路径。
  • 在“游戏标题”字段中,输入“Vortex”。
  • 点击“添加”按钮。

3. 转换 nxm 链接

  • 将要下载的 nxm 链接复制到剪贴板。
  • 启动 Vortex。
  • 按 Ctrl + V 粘贴 nxm 链接。

Vortex 现在应该会自动下载并安装所选模组。

示例代码

更新后的 vortex-downloads-handler.desktop 文件:

[Desktop Entry]
Categories=Game;Network;
Comment[en_US]=NXM Protocol Download Handler
Comment=NXM Protocol Download Handler
Exec=sh -c "CONFIGPATH=$(sqlite3 ~/.local/share/lutris/pga.db "select configpath from games where installer_slug = \"vortex-mod-manager-wine\" order by id asc limit 1;") && sed -i \"s/^  args:.*$/  args: -d $(printf \"%%s\\\\\\\\n\" \"%u\" | sed \"s/^'//;s/'$//;s/\\//\\\\\\\\\\\\\\\\\\\\\\\\//g;s/\\\\\\\\&/\\\\\\\\\\&/g\")/\" \"/home/doggy/.config/lutris/games/$CONFIGPATH.yml\" && env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/$(sqlite3 ~/.local/share/lutris/pga.db \"select id from games where installer_slug = \"vortex-mod-manager-wine\" order by id asc limit 1;\")"
GenericName[en_US]=Writes the provided nxm url as an argument to Vortex by editing the Lutris game config for Vortex twice before launching.
GenericName=Writes the provided nxm url as an argument to Vortex by editing the Lutris game config for Vortex twice before launching.
Icon=lutris_vortex-mod-manager
MimeType=x-scheme-handler/nxm-protocol;x-scheme-handler/nxm;
Name[en_US]=Vortex
Name=Vortex
NoDisplay=true
Path=/mnt/diskd/Games/vortex-mod-manager
StartupNotify=true
Terminal=false
Type=Application

常见问题解答

  • 为什么需要使用桌面条目链接处理程序?

    桌面条目链接处理程序允许您将文件类型(如 nxm 链接)与特定的应用程序(如 Vortex)相关联。通过创建桌面条目链接处理程序,我们可以让 nxm 链接自动在 Vortex 中打开。

  • 我需要修改哪些特定文件?

    您需要编辑 ~/.local/share/applications/vortex-downloads-handler.desktop 文件。

  • 是否可以将这些步骤应用于其他应用程序?

    是的,这些步骤可以应用于需要处理特定文件类型的任何应用程序。

  • 如果我对修改 .desktop 文件感到不舒服,还有什么其他选择?

    您可以尝试使用 Nexus Mods Vortex 扩展,该扩展可以在 Nexus Mods 网站上下载。

  • 我仍然无法让 Vortex 正常处理 nxm 链接,我该怎么办?

    确保您已按照步骤操作并正确配置了 .desktop 文件。如果您遇到问题,请参阅 Vortex 或 Lutris 的官方文档,或寻求社区支持。