跳至內容
出自 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#安裝以為您的 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 的內容決定了遊戲的目錄名稱。

注意:為使從 flathub 安裝的 Steam 能夠添加另外的驅動器,用戶必須授予 Steam 客戶端訪問該驅動器所在掛載點的權限,可以使用 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

參見 HiDPI#Steam

無窗口管理器的大屏幕模式

欲從顯示管理器Gamescope混成器直接以大屏幕模式啟動 Steam:

/usr/share/wayland-sessions/steam-big-picture.desktop
[Desktop Entry]
Name=Steam 大屏幕模式
Comment=以大屏幕模式啟動 Steam
Exec=/usr/bin/gamescope -e -- /usr/bin/steam -tenfoot
Type=Application
注意:其中 -tenfoot 選項告訴 Steam 以大屏幕模式啟動。

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 庫文件夾,然後點擊加號添加庫文件夾。


有三種文件系統支持被 Windows 和 Linux 讀寫。

NTFS

更多信息參見 Proton wiki。欲從 NTFS 文件系統啟動遊戲,請遵循 Steam/疑難解答#Steam Library in NTFS partition.

使用 NTFS 的不足之處在於會經常發生著色器緩存文件夾損壞,報錯信息為 ntfs3: sdb6 ino=1921f, steamapprun_pipeline_cache Looks like your dir is corrupt. 且無法在 Linux 下修復,需要在 Windows 下使用 chkdsk 修復。

EXFAT

該文件系統的不足在於大小寫不敏感,您會遇到 SteamLibrary has both 'SteamApps' and 'steamapps' directories. This will cause problems. Please fix manually and only keep 'steamapps' 。參見 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

該文件系統可以幾乎無痛使用。唯一要注意的是 Linux 目前不支持 udf 2.50+ 版本的寫入。可以使用 Gparted 創建 udf 文件系統,其會是 2.01 版本。

加速著色器預編譯

某些情況下著色器預編譯可能僅使用一個核心,用戶可以修改此類行為,例如改為 8 個核心:

~/.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.

禁用 HTTP2 以加速下載

部分系統和配置似乎在 HTTP2 上有些問題,禁用 HTTP2 可能會在這些情況下加快下載速度。

您可以執行控制台命令 @nClientDownloadEnableHTTP2PlatformLinux 0 或在 steam_dev.cfg 使用如下配置:

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

使用獨立顯卡運行遊戲

在使用混合圖形技術的筆記本電腦上,Steam 默認使用集成顯卡運行遊戲,欲使用性能更為強勁的獨立顯卡運行遊戲,請參閱 PRIME#PRIME GPU 分載

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 設置

這對顯存較小的顯卡很有幫助。

複製一份 Steam 桌面項

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

修改新複製文件的 Exec=Name= 行:

~/.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

當啟動 Steam Minimal (Runtime) 時,您會看到一個索然無味的界面,不過已經足以安裝和運行遊戲。運行原先標準的 Steam (Runtime) 則會啟動完整的 Steam 客戶端。

疑難解答

參見Steam/疑難解答

另見