跳转到内容

Steam

来自 Arch Linux 中文维基

本文或本节需要翻译。要贡献翻译,请访问简体中文翻译团队

附注: 本文尚未翻译完成(在 Talk:Steam# 中讨论)

Steam 是 Valve 公司推出的著名游戏分发平台。

注意:对于 Linux 平台,Steam 只支持 Ubuntu 的长期支持版本[1]。 因此,请不要向 Valve 公司提交 issue 以获得 Steam 对 Arch Linux 的支持。

安装[编辑 | 编辑源代码]

启用 multilib 仓库并安装 steam 软件包(推荐),也可以安装 steam-native-runtime 以使用由原生系统库驱动的 Steam(即 steam-native),参阅/疑难解答#Steam runtime

注意:若您是第一次安装,您可能需要选择 32 位 Vulkan 驱动程序软件包,而 pacman 会按照字母表顺序默认选择 lib32-amdvlk,这可能会引发一些问题,如安装了与 GPU 完全不适配的驱动而导致无法使用 Vulkan,或是不与 amdvlk 一起安装而在 AMD GPU 上启动游戏。参阅 Vulkan#Installation 以为您的 GPU 选择合适的驱动。

要在 Arch Linux 上运行 Steam,您需要满足以下需求:


SteamCMD[编辑 | 编辑源代码]

安装 steamcmdAUR 以使用命令行版本的 Steam

目录结构[编辑 | 编辑源代码]

Steam 的默认安装位置是 ~/.local/share/Steam。如果 Steam 无法找到该目录,它会指导你重新安装或选择一个新的安装位置。这篇文章使用 ~/.steam/root 符号链接来表示 Steam 的安装位置。

库文件夹[编辑 | 编辑源代码]

每一个 Steam 应用都有一个独一无二的应用 ID,你可以通过 Steam Store 的页面路径或在 SteamDB 中来找到它。

Steam 将游戏安装到 LIBRARY/steamapps/common/ 目录下。库文件夹 LIBRARY 一般会是 ~/.steam/root,但是你依然可以选择拥有多个库文件夹如 (Steam > Settings > Storage >(+)Add Drive)。

为了 Steam 能够正确识别游戏,它需要在 LIBRARY/steamapps/ 目录下找到 appmanifest_AppId.acf 文件。此清单文件使用了 KeyValues 格式,并且它的 installdir 的内容决定了游戏的目录名称。

注意:In order to add additional drives to a Steam installation made through flathub, the user must first give the Steam Client authorization to access the mount-point of the additional drive manually through a tool such as flatsealAUR.

用法[编辑 | 编辑源代码]

steam [ -options ] [ steam:// URL ]

对于可用的命令行选择,详见 Command Line Options article on the Valve Developer Wiki

Steam 也可以接受可选的 Steam URL,详见 Steam browser procotol

启动选项[编辑 | 编辑源代码]

当你运行一个 Steam 游戏时,Steam 会使用 /bin/sh 执行它的启动命令。 为了让你自由修改启动命令,Steam 提供了启动选项启动选项可以通过右键点击你的游戏库中的游戏,选择属性后点击设置启动选项进行修改。

默认情况下 Steam 只是简单的把你设置的参数字符串添加到游戏的启动命令后。想要设置环境变量或者将一个启动命令作为参数传递给另一个命令,你可以使用 %command% 以表示原启动命令。

示例[编辑 | 编辑源代码]

  • 仅设置参数: -foo
  • 设置环境变量: FOO=bar BAZ=bar %command% -baz
  • 设置与默认完全不同的命令: othercommand # %command%

提示与技巧[编辑 | 编辑源代码]

最小化启动[编辑 | 编辑源代码]

在系统启动时,使 Steam 以最小化方式自启在系统托盘处是可以实现的,并且不会占据鼠标焦点。仅仅需要添加 -silent 到自启文件的参数列表中。

~/.config/autostart/steam.desktop
...
Exec=/usr/bin/steam -silent
...

小模式[编辑 | 编辑源代码]

Steam 支持一个最小化的替代 UI,仅仅包含您的游戏列表——隐藏了商店、社区和封面合集视图均被隐藏。可通过查看 > 小模式切换到该模式,通过查看 > 大模式回到标准模式。

fsync 补丁[编辑 | 编辑源代码]

Valve 公司的 fsync 补丁为使用Proton或Wine运行的大型应用改进了性能。此补丁自Linux内核5.16版本以来,已经合并到了 vanilla 内核,只需使用最新的 Proton 或修改版 Wine 构建即可。若想使用支持fsync的早期的内核版本:

Proton Steam-Play[编辑 | 编辑源代码]

Valve 公司开发了一个兼容性工具Proton,用来使 Steam 可以在 Wine 和其他额外组件上运行。这使得你可以运行很多原本只能在 Windows 平台上运行的游戏(详见 compatibility list)。

此工具开源并且可以从 GitHub 获得。Steam 将在 Steam Play 启用后安装它相适应的 Proton 版本。

Proton 需要在 Steam 客户端启用:Steam > 设置 > 兼容性。你可以为了上述那些没有被 Valve 公司列入白名单的游戏启用 Steam Play。

如果开发者激活,Proton 支持 Easy Anti Cheat 集成,但是 EAC 可能需要某个特定修补版本的 glibc:如果某个游戏据报告可以运行而在您的设备上却不行,请尝试使用 Steam Flatpak,因为其附带了修补的 glibc。

强制使用 Proton[编辑 | 编辑源代码]

如果需要为某个游戏启用 Proton 或某特定版本的 Proton,右键该游戏,选择属性 > 兼容性 > 强制使用特定 Steam Play 兼容性工具,选择需要的版本。这种做法也可以强制使一个具有 Linux 接口的游戏运行 Windows 版本。

使用 Steam 外的 Proton[编辑 | 编辑源代码]

您可以安装 proton-cachyosAUR,但是需要一些额外的配置才能在 Steam 上良好运行。想要了解 Steam 如何识别已安装的 Proton 的更多细节,请参阅 Proton GitHub

提示:archlinuxcn 源包含一个 protonCNRepo 软件包,不同于 proton-cachyosAUR,您也可以安装此软件包以节省时间。

Steam Input[编辑 | 编辑源代码]

本文或本节内容已经过时。

原因: the options mentioned here are no longer available in the Steam client (在Talk:Steam讨论)

When a controller is plugged in while Steam is running, Steam's default behavior is to leave it alone and let games use it as-is. The gamepad's evdev and joystick devices are exposed by the kernel, and games may use them using APIs such as SDL2 as if Steam were not in the picture.

The Steam Input subsystem offers an abstraction layer which allows for more advanced functionality such as rebinding buttons and axes, having game-specific profiles, and doing higher-level button mappings based on in-game actions. The Steam Input Configurator (SIC) is the part of the system that implements this functionality. To enable Steam Input for a controller, go to Steam > Settings > Controller > General Controller Setting. [3] This will open a menu from the Big Picture settings, where you can enable the Configuration Support option corresponding to your controller.

Steam Input Configurator[编辑 | 编辑源代码]

When SIC is enabled for a controller, there are a few different controller devices:

  • The virtual Steam Controller, used by games that utilize the Steam Input API. All rebindings and Steam-specific features are functional.
  • An evdev device representing an emulated Xbox 360 controller, used by games that do not support Steam Input. Basic rebindings are in effect. [4]
  • The original controller evdev device, whose inputs are passed through the SIC. Rebindings are not in effect, but games should be defaulting to the 360 controller instead.
  • The joystick analogues of the above two devices.

The SIC's behavior is context dependent:

  • When launching a game that supports the Steam Input API, it is using the SIC in native mode. The game receives "actions" rather than raw inputs to handle.
    • This works for games running in Proton that would be using Steam Input on Windows.
    • Even though it's theoretically not needed, the emulated 360 controller is still present.
    • A game may choose to provide both support for the Steam Input, and traditional input API libraries that defer to evdev and joystick under the hood. When the game is launched with Steam and with SIC enabled for the controller, Steam Input takes higher priority.
    • A game can also choose to only support Steam Input. For example, in Among Us, a gamepad will not work unless you have the SIC running.
  • When launching a game that does not support Steam Input, it is (unknowingly) using the SIC in legacy mode. The game receives its expected low-level raw inputs from what seems to be a 360 controller, but they are actually spoofed by the SIC to emulate the desired behavior of native mode.
    • This is the case for native games that use evdev or joystick, as well as Windows games running through Proton that use DirectInput or XInput.
  • When launching a game that supports neither Steam Input nor other gamepad APIs, SIC can activate a profile that emulates gamepad support as described below.
  • When Big Picture has focus, the current Big Picture profile is in effect, configurable via Steam > Settings > Controller > Big Picture Configuration.
  • When anything else has focus, the current Desktop profile is in effect, configurable via Steam > Settings > Controller > Desktop Configuration.
  • When anything has focus, additional global bindings can be configured via Steam > Settings > Controller > Guide Button Chord Configuration.

Games are rated on how comprehensive their gamepad support is. A game can have one of three icons in the Big Picture UI: [5]

  • A full gamepad icon, indicating that the game has full controller support. This can be achieved even if the game does not use the Steam Input API; the focus is on accessibility regardless of API.
  • A half-filled gamepad icon, indicating that the game has partial gamepad support. Even if the game is using the Steam Input API, there are instances like Team Fortress 2 where certain parts are still inaccessible to warrant this rating.
  • A keyboard icon, indicating the game does not have native gamepad support.

In cases where the game does not have full gamepad support, SIC tries to fill the gaps. For example, in Bloons Tower Defense 5, a game that requires you to point and click, Steam will automatically activate the Keyboard (WASD) and Mouse profile, allowing you to use your gamepad to move and click.

Recommended Steam Input usage[编辑 | 编辑源代码]

To summarize what this all means for usage:

  • Enabling "Configuration Support" in the Big Picture settings is recommended for enhanced gamepad support such as rebinding to one's liking, or automated fixes like Nintendo-style button remapping or keyboard/mouse.
  • For some games, enabling this is outright required if they do not support traditional gamepad APIs.
  • By default, if you have enabled this, then the controller will not work with non-Steam games because the 360 controller takes precedence over the original controller device, but the default Desktop profile has the buttons disabled. To fix this, you can either:
    • Set your Desktop profile to the template for Gamepad. This will pass through the inputs to the 360 controller, making the default device usable for other programs.
    • Have the other game use the original device if it supports this. Note that the game will not benefit from any Steam Input rebindings.
    • Disable the whole feature for the controller so Steam does not create the 360 controller at all. Note that Steam games would then not benefit from the enhanced gamepad support.
    • Close Steam when using the other games.

Disabling Steam Input[编辑 | 编辑源代码]

If you wish to completely disable Steam Input, launch steam with the -nojoy argument, and also disable Steam Input for each game individually, as there is no global option for doing so.

HiDPI[编辑 | 编辑源代码]

See HiDPI#Steam.

无窗口管理器的大屏幕模式[编辑 | 编辑源代码]

To start Steam in Big Picture Mode from a display manager with Gamescope as its compositor:

/usr/share/wayland-sessions/steam-big-picture.desktop
[Desktop Entry]
Name=Steam Big Picture Mode
Comment=Start Steam in Big Picture Mode
Exec=/usr/bin/gamescope -e -- /usr/bin/steam -tenfoot
Type=Application
注意:The -tenfoot flag tells Steam to start in Big Picture Mode.

Steam 皮肤[编辑 | 编辑源代码]

使用皮肤可以自定义 Steam 界面。皮肤可以被位于 ~/.steam/root 的界面定义文件所覆盖。

想要安装一个皮肤:

  1. 将皮肤的目录放于 ~/.steam/root/skins
  2. 按照 Steam > 设置 > 界面依次点击并选择该皮肤。
  3. 重启 Steam。

你可以在 Steam 论坛获得比较完备的皮肤列表。

注意:使用一个过期的皮肤可能会引起一些可视化错误。

自创皮肤[编辑 | 编辑源代码]

几乎所有的 Steam 风格会定义在 ~/.steam/root/resource/styles/steam.styles (此文件超过 3,500 行)。对于一个可以被 Steam 识别的皮肤,它需要自己的 resource/styles/steam.styles 文件。 当一个 Steam 的更新改变了官方的 steam.styles 文件,你的皮肤可能会过期,会有造成可视化错误的潜在风险。

详见 ~/.steam/root/skins/skins_readme.txt 以获得如何创建皮肤的初步指引。

改变 Steam 的通知位置[编辑 | 编辑源代码]

默认情况下 Steam 的通知会在屏幕底端右侧出现。

你可以改变 Steam 通知出现的位置,通过更改 Notifications.PanelPosition 文件,具体位于

  • resource/styles/steam.styles 以调整桌面通知
  • resource/styles/gameoverlay.styles 以调整游戏中通知

以上两个文件都将在 Steam 启动时被覆写,且 steam.styles 只会在启动时被读取。

注意:一些游戏并不遵守位于 gameoverlay.styles 里的设置。如《幽浮:未知敌人》。

使用一个皮肤[编辑 | 编辑源代码]

你可以创建一个皮肤去将通知位置改变成你想要的那样。比如你想要将位置设置成顶部右侧:

$ cd ~/.steam/root/skins
$ mkdir -p Top-Right/resource
$ cp -r ~/.steam/root/resource/styles Top-Right/resource
$ sed -i '/Notifications.PanelPosition/ s/"[A-Za-z]*"/"TopRight"/' Top-Right/resource/styles/*

实时更新[编辑 | 编辑源代码]

gameoverlay.styles 文件可以在 Steam 运行时更改,这允许你对不同游戏设置不同的通知位置。

~/.steam/notifpos.sh
sed -i "/Notifications.PanelPosition/ s/\"[A-Za-z]*\"/\"$1\"/" ~/.steam/root/resource/styles/gameoverlay.styles

由此 #启动选项应该像下面这样:

~/.steam/notifpos.sh TopLeft && %command%

Steam 远程同乐[编辑 | 编辑源代码]

注意:Steam 家庭流媒体 已更新为 Steam 远程同乐

Steam 内置对于远程同乐的支持。

前往 Steam 社区指南以了解如何在 Linux 上设置无头模式的流媒体服务。

Steam Controller[编辑 | 编辑源代码]

通常一个 Steam Controller 手柄需要使用 Steam 界面。不过在非 Steam 原生的 Linux 游戏中这种界面并不很实用。对此,当 Steam 客户端运行时,其会保持一个“桌面配置”。如果你有 Steam Controller 手柄,请在桌面配置中将其设置为通用 XBOX 控制器。只要 Steam 客户端在运行,你可以在其他游戏中使用 Steam Controller 手柄,例如 GOG 的游戏, 就像一个 XBOX 手柄。请确保在“常规手柄设置”已经选择了你的手柄类型。

使用 Proton 时与 Windows 共用游戏[编辑 | 编辑源代码]

如果使用 Proton(Steam Play)启动游戏,并且由于某些原因仍然保留在Windows上安装的版本(例如某些游戏的反作弊系统有问题,或是要与Windows对比测试),那么可能会想把游戏存储在同一个分区里,而不是每个操作系统里分别保留一个游戏副本。关于如何配置,详见 https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows

若要在Steam的游戏库中添加其它文件夹,选择 Steam → 设置 → 下载 → STEAM 库文件夹,然后点击加号添加库文件夹。


There are three file systems, that can be read/write by both Windows and Linux.

NTFS[编辑 | 编辑源代码]

See https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows for more information on how to configure that. To launch games from an NTFS drive, follow the steps from Steam/Troubleshooting#Steam Library in NTFS partition.

Using ntfs has disadvantages. It happens often that shaders cache folder becomes corrupted. Messages saying ntfs3: sdb6 ino=1921f, steamapprun_pipeline_cache Looks like your dir is corrupt. You cannot fix that from linux. You need to boot to Windows and use chkdsk for that.

EXFAT[编辑 | 编辑源代码]

This FS has disadvantage that it is case-insensitive. You will get such message: SteamLibrary has both 'SteamApps' and 'steamapps' directories. This will cause problems. Please fix manually and only keep 'steamapps' See issue #7665

Also it is problematic to create symlinks on exfat, so you cannot use the method of symlinking compatdata as in ntfs method.

UDF[编辑 | 编辑源代码]

This file system can be used without a problem. The only thing to remember is that Linux has not yet write support to udf 2.50+. So just create a udf formatted partition in Gparded, and it will be 2.01.

Faster shader pre-compilation[编辑 | 编辑源代码]

In certain circumstances shader pre-compilation may only use one core, however this can be overridden by the user, example to use 8 cores:

~/.steam/steam/steam_dev.cfg
unShaderBackgroundProcessingThreads 8

Compatibility layers other than Proton[编辑 | 编辑源代码]

There are compatibility tools other than Proton/Wine.

  • Luxtorpeda — Run games using native Linux engines.
https://luxtorpeda-dev.github.io/ || luxtorpeda-gitAUR
  • Boxtron — Run DOS games using native Linux DOSBox
https://github.com/dreamer/boxtron || boxtronAUR

You can also use protonup-qtAUR to manage them:

  1. Close Steam
  2. Install protonup-qtAUR
  3. Open protonup-qt and install desired tools
  4. Start Steam
  5. In the game properties window, select Force the use of a specific Steam Play compatibility tool and select the desired tool.

Disable HTTP2 for faster downloads[编辑 | 编辑源代码]

Some systems and configurations seem to have issues with HTTP2. Disabling HTTP2 will probably yield faster downloads on those configurations. You can either use the console command @nClientDownloadEnableHTTP2PlatformLinux 0 or set it in steam_dev.cfg like so:

~/.steam/steam/steam_dev.cfg
@nClientDownloadEnableHTTP2PlatformLinux 0

Run games using discrete GPU[编辑 | 编辑源代码]

On hybrid graphics laptops, Steam runs games using the integrated GPU by default. See PRIME#PRIME GPU offloading to switch to the more powerful discrete GPU for specific games.

Flatpak[编辑 | 编辑源代码]

注意:Installing Steam from Flathub/Flatpak will fix many of the issues faced on the client but will require alternative, less documented forms of troubleshooting on the long run.

Steam can also be installed with Flatpak as com.valvesoftware.Steam from Flathub. The easiest way to install it for the current user is by using the Flathub repository:

$ flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak --user install flathub com.valvesoftware.Steam
$ flatpak run com.valvesoftware.Steam

The Flatpak application currently does not support themes. Also you currently cannot run games via optirun/primusrun, see Issue#869 for more details.

Steam installed via Flatpak is not able to access your home directory and overriding this will cause Steam to not run because it is not safe. However, you can freely add directories outside the home directory. If you want to add an external library, run the following command to add it:

$ flatpak override --user com.valvesoftware.Steam --filesystem=/path/to/directory

Launching Steam with Flatpak might warn you about installing the steam-devices package. This package currently does not exist but game-devices-udevAUR can be installed instead, see Gamepad#Device permissions.

Asian Font Problems with Flatpak[编辑 | 编辑源代码]

If you are having problem getting Asian fonts to show in game, it is because org.freedesktop.Platform does not include it. First try mounting your local font :

$ flatpak run --filesystem=~/.local/share/fonts --filesystem=~/.config/fontconfig com.valvesoftware.Steam

If that does not work, consider this hack: make the fonts available by directly copying the font files into org.freedesktop.Platform's directories, e.g.

/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/version/hash/files/etc/fonts/conf.avail
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/version/hash/files/etc/fonts/conf.d 
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/version/hash/files/share/fonts

Steam Flatpak start (run) issues[编辑 | 编辑源代码]

After launch, Steam will try to download files and you will see a progress bar. If it crashes, you may try to give additional permissions to the flatpak package:

$ flatpak permission-set background background com.valvesoftware.Steam yes
$ flatpak run com.valvesoftware.Steam

For an alternative way to control permissions, install flatseal.

Steam settings to reduce video card memory usage[编辑 | 编辑源代码]

This is useful for video cards with a small amount of video memory.

Make a copy of the Steam shortcut:

$ cp /usr/share/applications/steam.desktop ~/.local/share/applications/steam_minimal.desktop

and change the Exec= and Name= sections in the shortcut copy:

~/.local/share/applications/steam_minimal.desktop
Name=Steam Minimal (Runtime)
Exec=/usr/bin/steam-runtime -cef-disable-gpu-compositing -cef-disable-gpu steam://open/minigameslist %U

As a result, when launching the Steam Minimal (Runtime) shortcut you will get an ascetic interface, which is still functional enough to install and run games, and when launching the standard Steam (Runtime) shortcut you will get a full-fledged client.

疑难解答[编辑 | 编辑源代码]

参见Steam/疑难解答

有关steam及其游戏在hyprland下高分辨率同时缩放导致的模糊的问题[编辑 | 编辑源代码]

在monitor = , highres, auto, 2行下方加入以下参数,这将禁用xwayland软件的缩放以解决问题:

# unscale XWayland
xwayland {
  force_zero_scaling = true
}

# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32

参见https://wiki.hyprland.org/Configuring/XWayland/

另见[编辑 | 编辑源代码]