2023年7月28日 星期五

steam deck linux 操作

[linux 相關操作]

fig 1. linux console 畫面

在 steam 遊戲模式下按下 alt+ctrl+f5 就可以看到 fig 1 畫面, 這是 linux console 登入畫面。可以想成是沒有 gui 的操作環境, 類似 dos, 在這個模式下接上鍵盤會比較好操作。

另外參考 ENABLING SSH SERVER ON A STEAM DECK 開啟 sshd, 可以登入 steam deck, 在沒有鍵盤、滑鼠之下, 比較容易操作, 我只要有終端機就可以了, 會用 linux 真好。預設的使用者是 deck, 需要設定密碼, 再使用 sudo -s 切到 root, 啟動 sshd 之後 (sudo systemctl start sshd), 就可以用 ssh 登入, 該文章的指令對會用 linux 的人來說, 像吃飯一樣容易, 如果不熟悉 linux, 可能要花點功夫。我不熟悉的是 arch linux, 但這和使用 linux 不會有太大關係。不過 steam deck ssh 操作感很遲鈍, 理論上不應該這樣, 猜測可能被調整了優先權。

為了使用 X11Forwarding 設定以下內容
/etc/ssh/sshd_config
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10

ssh 加入 -X, 這樣可以把 xterm/dolphin 投到 pc 的 X, 會好操作些。
ssh deck@1.3.8.2 -X
ref:
執行遠端的 X 應用程式包含中文輸入法
steam deck linux kernel 版本:
(deck@steamdeck data)$ uname -a
Linux steamdeck 5.13.0-valve36-1-neptune #1 SMP PREEMPT Mon, 19 Dec 2022 23:39:41 +0000 x86_64 GNU/Linux

linux kernel source code:
https://gitlab.com/evlaV/linux-integration
https://github.com/batocera-linux/batocera.linux/issues/5813

ssd 分割資訊, 遊戲放在 /home, 是 ext4
(deck@steamdeck /)$ df -T
Filesystem     Type     1K-blocks      Used Available Use% Mounted on
devtmpfs       devtmpfs   7546356         0   7546356   0% /dev
tmpfs          tmpfs      7587128    484588   7102540   7% /dev/shm
tmpfs          tmpfs      3034852     10036   3024816   1% /run
/dev/nvme0n1p4 btrfs      5242880   3360392   1558728  69% /
/dev/nvme0n1p6 ext4        235431     39365    178863  19% /var
overlay        overlay     235431     39365    178863  19% /etc
/dev/nvme0n1p8 ext4     488454168 481068012   7369772  99% /home
tmpfs          tmpfs      7587128       796   7586332   1% /tmp
tmpfs          tmpfs      1517424       216   1517208   1% /run/user/1000
/dev/nvme0n1p2 vfat         32686       684     32002   3% /efi

由於有看到 efi, 所以 steam deck 應該是用 uefi, 一般說的進入 bios 就是指進入 efi 畫面, 所以要做到多重開機, 使用 grub 應該就可以辦到。但是折騰這些事情很累人, 我只想好好打電動, 並不想把它當電腦來搞, 不過為了一些模擬器和 dosbox 還是花了一些力氣搞一些設定, 真的蠻累, 還是玩遊戲輕鬆多了。所以安裝什麼 plugin 的那些, 就沒有繼續下去, 我也不想去安裝 windows。至於換 ssd 這種要碰硬體的, 更是不敢做, 搞壞了就麻煩了, 要也是等過保固再來嘗試。/ 區域是唯讀的, 不知道怎麼辦到的, 所以無法對 /sbin 這些目錄寫入, /etc 則是可以寫入。

以下指令可以解開唯讀。
steamos-readonly disable
steamos-readonly enable

看了 steamos-readonly 內容之後就知道怎麼做了, 把 / mount 成 read only。

(deck@steamdeck ~)$ pwd
/home/deck
(deck@steamdeck ~)$ ls
Desktop    Downloads  Pictures  Rusty      Videos
Documents  Music      Public    Templates

遊戲抓的圖存在這, 比較討厭的是不知道那個數字是那個遊戲
~/.local/share/Steam/userdata/138196433/760/remote/7/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/8000/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/1902490/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/838380/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/311730/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/19680/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/454650/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/359870/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/524220/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/958260/screenshots
~/.local/share/Steam/userdata/138196433/760/remote/1163550/screenshots

5661 tty1     Sl+    0:07 /usr/lib/Xorg -nolisten tcp -background none -seat seat0 -noreset -keeptty -novtswitch -verbose 3 -auth /run/user/1000/ba25c22d-90c0-4293-99fc-3c34419422a2 -displayfd 12 vt1

Xwayland :1 -rootless # 20230718 發現變成 Xwayland 了。
[proton 在哪裡]

以下是 steam 裝的 proton 版本, bin/wine 是執行檔。
./.local/share/Steam/steamapps/common/Proton Hotfix/files/bin/wine
~/.local/share/Steam/steamapps/common/Proton Hotfix/files/share/wine
~/.local/share/Steam/steamapps/common/Proton Hotfix/files/lib/wine
~/.local/share/Steam/steamapps/common/Proton Hotfix/files/lib64/wine
~/.local/share/Steam/steamapps/common/Proton - Experimental/files/bin/wine
~/.local/share/Steam/steamapps/common/Proton - Experimental/files/share/wine
~/.local/share/Steam/steamapps/common/Proton - Experimental/files/lib/wine
~/.local/share/Steam/steamapps/common/Proton - Experimental/files/lib64/wine
~/.local/share/Steam/steamapps/common/Proton 7.0/dist/bin/wine
~/.local/share/Steam/steamapps/common/Proton 7.0/dist/share/wine
~/.local/share/Steam/steamapps/common/Proton 7.0/dist/lib/wine
~/.local/share/Steam/steamapps/common/Proton 7.0/dist/lib64/wine
~/.local/share/Steam/steamapps/common/Proton 8.0/dist/bin/wine
~/.local/share/Steam/steamapps/common/Proton 8.0/dist/share/wine
~/.local/share/Steam/steamapps/common/Proton 8.0/dist/lib/wine
~/.local/share/Steam/steamapps/common/Proton 8.0/dist/lib64/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-54/files/bin/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-54/files/share/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-54/files/lib/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-54/files/lib64/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-16/files/bin/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-16/files/share/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-16/files/lib/wine
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-16/files/lib64/wine
以下是 heroicgameslauncher 裝的 proton。
./.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton/Proton-GE-Proton8-1/files/bin/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton/Proton-GE-Proton8-1/files/share/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton/Proton-GE-Proton8-1/files/lib/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton/Proton-GE-Proton8-1/files/lib64/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine/Wine-GE-Proton8-1/bin/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine/Wine-GE-Proton8-1/share/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine/Wine-GE-Proton8-1/lib/wine
~/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine/Wine-GE-Proton8-1/lib64/wine

[為桌面安裝中文輸入法]
為桌面安裝中文輸入法, 本來不是很想搞桌面, 因為我不會把 steam deck 當電腦用, 哥是 linux 軟體工程師, 會需要 gcc 這些開發工具, 但我真的不想把這些東西裝到 steam deck 上, 後來把鍵盤、滑鼠接起來後, 想用瀏覽器上網, 發現不能打中文還是很麻煩, 那就裝個中文輸入法吧! 透過 Discover 安裝 fcitx, fcitx chewing, chinese addons, 執行 fcitx 之後 toolbar 會有一個鍵盤圖示可以設定。只有安裝中文輸入法, 桌面環境還是英文的。list 7. L10 ~ 12 就是安裝的中文輸入法相關套件。

fig 35. 中文輸入, 看不清楚點下去看大圖。

[arch linux 桌面安裝軟體]

終於知道 steam deck Discover 安裝套件是用 flatpak, 不是 arch 的 pacman, 而 / 下的內容無法被改動, 透過 flatpak 安裝的檔案是裝在別的地方。

dosbox 就是裝在這邊:
list 1 dosbox 安裝路徑
1 (B)(root@steamdeck /)# flatpak info -l com.dosbox.DOSBox
2 /var/lib/flatpak/app/com.dosbox.DOSBox/x86_64/stable/0231a921b5f1861dd47fc09e2aa48ecb5e1c36d9e3bc3052db8d769cbe2fa172

真正的執行檔是 dosbox, 裝在以下路徑, 使用 ldd 可以看到有些 .so 是找不到的, 要使用 flatpak 來執行, 才會正確設定這些 .so path。

dosbox 執行檔
 1 (1)(B)(root@steamdeck /)# ldd ./var/lib/flatpak/app/com.dosbox.DOSBox/x86_64/stable/0231a921b5f1861dd47fc09e2aa48ecb5e1c36d9e3bc3052db8d769cbe2fa172/files/bin/dosbox
 2       linux-vdso.so.1 (0x00007fff8b4b5000)
 3       libSDL_sound-1.0.so.1 => not found
 4       libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f7fe83cb000)
 5       libSDL-1.2.so.0 => not found
 6       libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f7fe8392000)
 7       libz.so.1 => /usr/lib/libz.so.1 (0x00007f7fe8378000)
 8       libSDL_net-1.2.so.0 => not found
 9       libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f7fe8233000)
10       libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f7fe81ad000)
11       libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f7fe7f76000)
12       libm.so.6 => /usr/lib/libm.so.6 (0x00007f7fe7e8e000)
13       libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f7fe7e6e000)
14       libc.so.6 => /usr/lib/libc.so.6 (0x00007f7fe7c85000)
15       /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f7feb573000)
16       libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f7fe7c5a000)
17       libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f7fe7ba2000)
18       libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f7fe7b70000)
19       libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f7fe7b6b000)
20       libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f7fe7b61000)

使用 flatpak 來執行 com.dosbox.DOSBox

使用 flatpak 執行 com.dosbox.DOSBox
1 (B)(root@steamdeck /)# cat /var/lib/flatpak/app/com.dosbox.DOSBox/x86_64/stable/0231a921b5f1861dd47fc09e2aa48ecb5e1c36d9e3bc3052db8d769cbe2fa172/export/bin/com.dosbox.DOSBox
2 #!/bin/sh
3 exec /usr/bin/flatpak run --branch=stable --arch=x86_64 com.dosbox.DOSBox "$@"

這不是我熟悉的套件安裝方式, 老實說我也不喜歡這個方式, 不過 steam deck 這麼做有其道理。

列出安裝的 app
 1 (130)(B)(root@steamdeck /)#  flatpak list --app
 2 Name                       Application ID                   Version              Branch     Installation
 3 DOSBox                     com.dosbox.DOSBox                0.74-3               stable     system
 4 DOSBox-X                   com.dosbox_x.DOSBox-X            2023.03.31           stable     system
 5 Flatseal                   com.github.tchx84.Flatseal       2.0.1                stable     system
 6 Google Chrome              com.google.Chrome                111.0.5563.110-1     stable     system
 7 Heroic Games Launcher      com.heroicgameslauncher.hgl      v2.7.1               stable     system
 8 OBS Studio                 com.obsproject.Studio            29.0.2               stable     system
 9 ProtonUp-Qt                net.davidotek.pupgui2            2.7.7                stable     system
10 Fcitx 5                    org.fcitx.Fcitx5                 5.0.19               stable     system
11 Telegram Desktop           org.telegram.desktop             4.8.3                stable     system
12 VLC                        org.videolan.VLC                 3.0.18               stable     system

list 7. 列出所有安裝的套件
 1 (B)(root@steamdeck /)#  flatpak list 
 2 Name                            Application ID                     Version          Branch      Installation
 3 DOSBox                          com.dosbox.DOSBox                  0.74-3           stable      system
 4 DOSBox-X                        com.dosbox_x.DOSBox-X              2023.03.31       stable      system
 5 Flatseal                        com.github.tchx84.Flatseal         2.0.1            stable      system
 6 Google Chrome                   com.google.Chrome                  111.0.5563.110-1 stable      system
 7 Heroic Games Launcher           com.heroicgameslauncher.hgl        v2.7.1           stable      system
 8 OBS Studio                      com.obsproject.Studio              29.0.2           stable      system
 9 ProtonUp-Qt                     net.davidotek.pupgui2              2.7.7            stable      system
10 Fcitx 5                         org.fcitx.Fcitx5                   5.0.19           stable      system
11 Chewing for Fcitx 5             org.fcitx.Fcitx5.Addon.Chewing     5.0.12           stable      system
12 Chinese Addons                  ….fcitx.Fcitx5.Addon.ChineseAddons 5.0.14           stable      system
13 Freedesktop Platform            org.freedesktop.Platform           22.08.12.1       22.08       system
14 i386                            ….freedesktop.Platform.Compat.i386                  22.08       system
15 Mesa                            …g.freedesktop.Platform.GL.default 21.3.9           21.08       system
16 Mesa                            …g.freedesktop.Platform.GL.default 23.1.1           22.08       system
17 Mesa (Extra)                    …g.freedesktop.Platform.GL.default 23.1.1           22.08-extra system
18 Mesa                            …freedesktop.Platform.GL32.default 23.0.2           22.08       system
19 ffmpeg-full                     ….freedesktop.Platform.ffmpeg-full                  22.08       system
20 openh264                        org.freedesktop.Platform.openh264  2.1.0            2.0         system
21 openh264                        org.freedesktop.Platform.openh264  2.1.0            2.2.0       system
22 GNOME Application Platform ver… org.gnome.Platform                                  44          system
23 Breeze GTK theme                org.gtk.Gtk3theme.Breeze           5.27.5           3.22        system
24 KDE Application Platform        org.kde.Platform                                    5.15-21.08  system
25 KDE Application Platform        org.kde.Platform                                    5.15-22.08  system
26 KDE Application Platform        org.kde.Platform                                    6.4         system
27 Telegram Desktop                org.telegram.desktop               4.8.3            stable      system
28 Telegram Desktop Webview Add-on org.telegram.desktop.webview       2.40.1           stable      system
29 VLC                             org.videolan.VLC                   3.0.18           stable      system


沒有留言:

張貼留言

使用 google 的 reCAPTCHA 驗證碼, 總算可以輕鬆留言了。

我實在受不了 spam 了, 又不想讓大家的眼睛花掉, 只好放棄匿名留言。這是沒辦法中的辦法了。留言的朋友需要有 google 帳號。