Steam 是 Valve 公司推出的著名遊戲分發平台。
安裝
啟用 multilib 倉庫並安裝 steam包 軟體包(推薦),也可以安裝 steam-native-runtime包 以使用由原生系統庫驅動的 Steam(即 steam-native),參閱/疑難解答#Steam runtime。
要在 Arch Linux 上運行 Steam,您需要滿足以下需求:
- 安裝 32 位版本的 OpenGL 圖形驅動。
- 生成 en_US.UTF-8 語言環境,以避免非法指針錯誤。
- 若您要將庫文件夾或非 Steam 遊戲添加到您的 Steam 庫,請安裝一個帶有文件選擇器的 XDG Desktop Portal 後端。
- 因其 GUI 大量使用了 Arial 字體,您需要做以下三者其一:
- 使用一個自由(免費,free)的替代品 ttf-liberation包。
- 按照微軟字體安裝原字體。
- 按照 Steam/疑難解答#Text is corrupt or missing 使用一個不同的字體。
- 安裝 wqy-zenhei包 以支持亞洲地區語言。
- 若使用 systemd-networkd 管理網絡,安裝 lib32-systemd包 才能讓Steam連上自己的伺服器。
- 若將 systemd-resolved 用於 DNS,請按照這些步驟修復
/etc/resolv.conf
以讓 Steam 解析主機名。 - 若使用大屏幕模式(Steam Deck UI),可能需要 NetworkManager 讓某些與網絡有關面板正常運行。
- 必須調大
vm.max_map_count
以讓某些遊戲免於崩潰,參見遊戲#增大 vm.max_map_count。
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
的內容決定了遊戲的目錄名稱。
用法
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的早期的內核版本:
- 安裝 linux-zen包 內核,其從 5.2 版本開始已包括 fsync 補丁。[2]
- 安裝 linux-pfAUR 或 linux-pf-gitAUR 內核。
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。
Steam Input
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.
- This is not to be confused with the Valve Steam Controller, the physical controller.
- 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:
- Install gamescope包
- Create the following desktop entry with the following contents:
/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
-tenfoot
flag tells Steam to start in Big Picture Mode.Steam 皮膚
使用皮膚可以自定義 Steam 界面。皮膚可以被位於 ~/.steam/root
的界面定義文件所覆蓋。
想要安裝一個皮膚:
- 將皮膚的目錄放於
~/.steam/root/skins
。 - 按照 Steam > 設置 > 界面依次點擊並選擇該皮膚。
- 重啟 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 社區指南以了解如何在 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.
- Boxtron — Run DOS games using native Linux DOSBox
You can also use protonup-qtAUR to manage them:
- Close Steam
- Install protonup-qtAUR
- Open protonup-qt and install desired tools
- Start Steam
- 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
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及其遊戲在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/
另見
- Gentoo:Steam
- The Big List of DRM-Free Games on Steam 位於 PCGamingWiki
- Fandom中的List of DRM-free games
- Steam Linux store
- Proton 支持 Steam Play 運行的基於 Wine 以及其他額外組件的兼容性工具
- ProtonDB crowdsourced Linux compatibility reports.