Steam/zh: Difference between revisions

Ardenet (talk | contribs)
Created page with "=== 提升性能 ==="
Ardenet (talk | contribs)
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 56: Line 56:
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}


{{note|<span class="mw-translate-fuzzy">如果您使用的是 Steam 控制器或 Valve Index,Steam 硬件支持会通过设置 <code>programs.steam.enable {{=}} true;</code> 将{{nixos:option|hardware.steam-hardware.enable}} 选项同步设置为 true 来隐性启用</span>}}
{{note|如果您使用的是 Steam 控制器或 Valve Index,Steam 硬件支持会通过设置 <code>programs.steam.enable {{=}} true;</code> 将 {{nixos:option|hardware.steam-hardware.enable}} 选项同步设置为 true 来隐性启用}}


{{note|<span lang="en" dir="ltr" class="mw-content-ltr">If you are using the Steam Controller released in 2026, the Steam client has an additional dependency on hidapi, needed to correctly communicate with the controller. If you are seeing repeated errors about failed firmware updates, this is likely why. You can add the dependency directly to the Steam environment like so: <code>programs.steam.extraPackages {{=}} [pkgs.hidapi];</code></span>}}
{{note|如果您使用的是 2026 年发布的 Steam 控制器,Steam 客户端需要额外依赖 hidapi 才能与控制器正确通信。如果您反复遇到固件更新失败的错误,这很可能是原因所在。您可以像这样直接将依赖项添加到 Steam 环境中:<code>programs.steam.extraPackages {{=}} [pkgs.hidapi];</code>}}


<span id="Tips_and_tricks"></span>
<span id="Tips_and_tricks"></span>
Line 66: Line 66:
=== 提升性能 ===
=== 提升性能 ===


<div lang="en" dir="ltr" class="mw-content-ltr">
您可以使用 [https://github.com/FeralInteractive/gamemode GameMode],这是一个针对 Linux 的库和守护程序组合,它允许游戏请求将一组优化指令以临时应用于主机操作系统和/或游戏进程。
You can utilize [https://github.com/FeralInteractive/gamemode GameMode], a combination of a library and daemon for Linux that allows games to request a set of optimizations to be temporarily applied to the host operating system and/or a game process.
</div>


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">
Line 116: Line 114:
=== Gamescope HDR ===
=== Gamescope HDR ===


<div class="mw-translate-fuzzy">
要使 HDR 在 gamescope 中工作,您可能需要单独启用 <code>enableWsi</code> 选项
要使 HDR 在 gamescope 中工作,您需要启用 <code>gamescope</code> 程序的同时,单独安装 <code>gamescope-wsi</code> 软件包
</div>


<syntaxhighlight lang="nix">programs.gamescope = {
<syntaxhighlight lang="nix">programs.gamescope = {
Line 238: Line 234:
GNOME 使用窗口类来确定与窗口关联的图标。Steam 目前在其 .desktop 文件中没有设置所需的键值<ref>https://github.com/ValveSoftware/steam-for-linux/issues/12207</ref>,但您可以通过编辑每个游戏的 .desktop 文件中的 <code>StartupWMClass</code> 键值来手动修复此问题,该文件位于 <code>~/.local/share/applications/</code> 目录下。
GNOME 使用窗口类来确定与窗口关联的图标。Steam 目前在其 .desktop 文件中没有设置所需的键值<ref>https://github.com/ValveSoftware/steam-for-linux/issues/12207</ref>,但您可以通过编辑每个游戏的 .desktop 文件中的 <code>StartupWMClass</code> 键值来手动修复此问题,该文件位于 <code>~/.local/share/applications/</code> 目录下。


<div class="mw-translate-fuzzy">
对于通过 Proton 运行的游戏,该值应为 <code>steam_app_<game_id></code> (<code><game_id></code>与 <code>Exec</code> 行中 steam://rungameid/ 之后的值匹配)。使用 [[Special:MyLanguage/Home Manager|Home Manager]](每次重建时执行)自动执行此操作:
对于通过 Proton 运行的游戏,该值应为 <code>steam_app_<game_id></code> (在哪里<code><game_id></code>与 <code>Exec</code> 行中 steam://rungameid/ 之后的值匹配)。
</div>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 292: Line 286:
=== Steam 未更新 ===
=== Steam 未更新 ===


<div class="mw-translate-fuzzy">
更新后重启 Steam 时,它会启动旧版本。([https://github.com/NixOS/nixpkgs/issues/181904 #181904])
更新后重启 $steam 时,它会启动旧版本。([https://github.com/NixOS/nixpkgs/issues/181904 #181904])
一个解决方法是删除 <code>/home/&lt;USER&gt;/.local/share/Steam/userdata</code> 目录下的用户文件。您可以在终端中使用 <code>rm -rf /home/&lt;USER&gt;/.local/share/Steam/userdata</code> 命令或文件管理器来完成此操作。之后,重启 Steam 即可重新生成配置。
一个解决方法是删除 <code>/home/&lt;USER&gt;/.local/share/Steam/userdata</code> 目录下的用户文件。您可以在终端中使用 <code>rm -rf /home/&lt;USER&gt;/.local/share/Steam/userdata</code> 命令或文件管理器来完成此操作。之后,重启 Steam 即可重新生成配置。
</div>


<span id="Game_fails_to_start"></span>
<span id="Game_fails_to_start"></span>
Line 312: Line 304:


<span id="Changing_the_driver_on_AMD_GPUs_<!-- this is not recommended due radv drivers performing better and generally more stable than amdvlk. My suggestion remove this section. source: https://forums.guru3d.com/threads/the-mesa-radv-amdvlk-thread.449774/ -->"></span>
<span id="Changing_the_driver_on_AMD_GPUs_<!-- this is not recommended due radv drivers performing better and generally more stable than amdvlk. My suggestion remove this section. source: https://forums.guru3d.com/threads/the-mesa-radv-amdvlk-thread.449774/ -->"></span>
<div class="mw-translate-fuzzy">
==== 更改 AMD GPU 的驱动程序 <!-- this is not recommended due radv drivers performing better and generally more stable than amdvlk. My suggestion remove this section. source: https://forums.guru3d.com/threads/the-mesa-radv-amdvlk-thread.449774/ -->====
==== 更改 AMD GPU 的驱动程序 ====
</div>


{{note|不建议这样做,因为 radv 驱动程序往往性能更好,而且通常比 amdvlk 驱动程序更稳定。}}
{{note|不建议这样做,因为 radv 驱动程序往往性能更好,而且通常比 amdvlk 驱动程序更稳定。}}
Line 343: Line 333:
=== 与 Steam 使用时 Gamescope 无法启动 ===
=== 与 Steam 使用时 Gamescope 无法启动 ===


<div class="mw-translate-fuzzy">
Gamescope 可能由于缺少 Xorg 库而无法启动。([https://github.com/NixOS/nixpkgs/issues/214275 #214275]) 要解决此问题,请添加以下内容覆盖 steam 包:
Gamescope 可能由于缺少 Xorg 库而无法启动。([https://github.com/NixOS/nixpkgs/issues/214275 #214275]) 要解决此问题,请添加以下内容覆盖 steam 包:
</div>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 366: Line 354:


<span id="Udev_rules_for_additional_Gamepads"></span>
<span id="Udev_rules_for_additional_Gamepads"></span>
=== 额外游戏手柄的 udev 规则 ===
=== 用于额外支持游戏手柄的 udev 规则 ===


在某些特定情况下,游戏手柄可能需要一些额外的配置才能正常工作,这些配置以 udev 规则的形式表示。这可以通过 <code>services.udev.extraRules</code> 来配置。
在某些特定情况下,游戏手柄可能需要一些额外的配置才能正常工作,这些配置以 udev 规则的形式表示。这可以通过 <code>services.udev.extraRules</code> 来配置。
Line 380: Line 368:
要查找设备的供应商和产品 ID,[https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils] 可能有用。
要查找设备的供应商和产品 ID,[https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils] 可能有用。


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Steam_controller_mouse_input_issues"></span>
=== Steam controller mouse input issues ===
=== Steam 控制器的鼠标输入问题 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
使用控制器进行鼠标输入时,可能无法控制视觉光标。在这种情况下,输入仍然会被识别,但光标不会移动。解决方法是使用 extest 预加载 Steam。Steam 安装包中已经提供了相应的选项:
Mouse input on the controller may fail to take control of the visual cursor. In this instance, the input is still registered, but the cursor does not move. A fix for this is to preload Steam with extest. The Steam package already has an option for it:
</div>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">