Skip to content

Instantly share code, notes, and snippets.

@fsworld009
Last active March 17, 2025 16:47
Show Gist options
  • Save fsworld009/191e19cdd551543a9e44846c70fd3f40 to your computer and use it in GitHub Desktop.
Save fsworld009/191e19cdd551543a9e44846c70fd3f40 to your computer and use it in GitHub Desktop.
Bazzite + GPD Win 4 notes

Prerequisite:

  1. Turn on Secure Boot
  2. https://github.com/hhd-dev/hhd?tab=readme-ov-file#extra-steps-gpd-win-devices
    1. set L4 to SYSRQ and R4 to PAUSE

Decky https://github.com/honjow/GPD-WinControl https://github.com/hhd-dev/hhd-decky

fixes

https://github.com/aarron-lee/gpd-win-tricks/blob/main/win4-gyro-suspend-fix/README.md

GTK theme

It's blank by default. Flatpak apps seems using the dark theme fine out of box.

I changed the setting once and couldn't revert it back, now flatpak apps won't use dark theme.

Current workaround is to add global env var in Flatseal GTK_THEME=adw-gtk3-dark

Note: The default theme in ~/.config/gtk-3.0/settings.ini and ~/.config/gtk-4.0/settings.ini in a new install is empty (no entry)

Alternatively, install org.gtk.Gtk3theme.Breeze then set it in KDE settings

Desktop mode lock screen

No lock screen feature by default.

Can follow https://github.com/RHOPKINS13/SteamDeckScreenLock, but need to change the exec to

Exec=loginctl lock-session

Ref: https://www.reddit.com/r/kde/comments/av3riz/command_to_lock_the_screen/

Bonus: relax failure unlock timeouts https://gist.github.com/fsworld009/cb9a402ede96fa6087a2562d987e82be#relax-the-rule-to-lock-out-10-mins-after-3-login-fails

Meta+L shortcut: KDE shortcut settings -> add application shortcut -> Select the .desktop file we just created

Proton-Qt

  1. Doesn't detect Lutris: run lutris once
  2. Old GE-Proton version not listed anymore: manual download and extract to ~/.steam/root/compatibilitytools.d/

Syncthing

https://www.reddit.com/r/SteamDeck/comments/10pdz5m/nonsteam_cloud_saves_between_steam_deck_and /

change port from 8080 to 8384 https://www.reddit.com/r/SteamDeck/comments/xjmal2/psa_for_anyone_using_syncthing_and_decky_at_the/

https://github.com/theCapypara/steamdeck-decky-syncthing

Startup movie

https://www.reddit.com/r/SteamDeck/comments/1ctg62q/is_there_anyway_to_have_steam_play_a_custom_boot/

Not sure why it's not in one installation but you can copy it from another install (from ~/.local/share/Steam/config/uioverrides/movies)

fcitx5

Built in, but no https://github.com/openvanilla/fcitx5-mcbopomofo

Tried follow the guide to build on fedora distrobox, failed with

CMake Error at /usr/share/cmake/Modules/CMakeCompilerIdDetection.cmake:127 (message):
  No preprocessor test for "PathScale"
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:340 (compiler_id_detection)
  /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:359 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)
  /usr/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (project)

Use flatpak fcitx5 for now. However this seems to disable the built-in fcitx5 install so I have to install Mozc on flatpak as well, even though it was installed in system already.

Konsole as default terminal

The default terminal in vanilla KDE is Konsole. However, Konsole has been removed by in bazzite image even if using KDE flavor.

It was an intended change by devs ublue-os/bazzite#1933

As a result it's better to install Konsole from flatpak.

(Optional) Install Konsole as system package

If you insist installing konsole as system package:

sudo rpm-ostree install konsole

Note that this means every update would require additional step to reinstall konsole and its dependencies. Should be fine in this case since konsole doesn't require any other dependency on top of bazzite image.

Change default terminal

Default terminal is set to ptyxis which is the Gnome terminal. To us Konsole, change it to Konsole in KDE settings.

If using system konsole

After doing it there will be a new shortcut ~/.local/share/applications/konsole.desktop, can update it to

[Desktop Entry]
Exec=/usr/bin/konsole
Name=Konsole
Type=Application
Icon=utilities-terminal

So it's visible in start menu

Alternatively you can use https://github.com/dnkmmr69420/enable-konsole-on-bazzite

Regenerate Grub menu

https://universal-blue.discourse.group/t/dual-boot-preliminary-setup-and-post-setup-guide/2743

ujust regenerate-grub

Built-in Lutris

Cannot use Wine game -> Open Bash terminal option (no window opened)

observed from lutris -d that it is trying to run

/usr/bin/ptyxis -e /home/fsworld009/.cache/lutris/run_in_term.sh

Run it manually would result in

Unkwon option -e

Solution is to change Preferences -> Toggle "Advanced" Global options -> Text based game emulator -> change to /usr/bin/konsole

Current blocker: tried (WineGE 8-12 + Sonic P06), the game cannot detect Steam Input. The same setup works when using flatpak Lutris.

Decky Loader

Some plugins may be unable to run shell commands due to linked library error. This is observed in two plugins currently:

  1. decky-recorder: unable to run ffmpeg
    ffmpeg: /tmp/_MEIMA8QQr/libssl.so.3: version `OPENSSL_3.2.0' not found (required by /lib64/libcurl.so.4)
    
  2. decky-syncthing
    /usr/bin/flatpak: /tmp/_MEIMA8QQr/libssl.so.3: version `OPENSSL_3.2.0' not found (required by /lib64/libcurl.so.4)
    

For decky-recorder, I manually grabed the actual commands in terminal, it would work. Further debugging showed that plugin processes have this env var injected:

LD_LIBRARY_PATH=/tmp/_MEIMA8QQr/

If I added it to my terminal session then I can get the same error.

It doesn't seem like decky-loader is injecting this var on purpose, but the main loader is packaged by PyInstaller, which would utilize this env var, according to their doc: https://pyinstaller.org/en/stable/runtime-information.html#ld-library-path-libpath-considerations

For now we will need to manually unset this env var in plugin scripts as workaround.

Decky recorder

Need manual patches due to issue mentioned above. https://github.com/fsworld009/decky-recorder-fork/releases/tag/v0.0.1-bazzite-patch

More detailed report SDH-Stewardship/decky-recorder-fork#47 (comment)

Curently enabling recording would break screenshot. Observed the same with the new Steam Game Recording, reported to ValveSoftware/gamescope#1489

decky-syncthing

The main script is not python, cannot edit directly in bin, but we can change the main.py to launch the bin without this env var:

Update env passed in at https://github.com/theCapypara/steamdeck-decky-syncthing/blob/v0.1.0/main.py#L102 to

env={**dict(os.environ), **{'LD_LIBRARY_PATH': ''}}

systemctl

Game mode related services

systemctl --user status gamescope-session-plus@steam
systemctl status return-to-gamemode

Use differnet gamescope binary for game mode

For testing if the bug is only presented in current build

systenctl --user edit gamescope-session-plus@steam

Add GAMESCOPE_BIN override

[Service]
Environment="GAMESCOPE_BIN=/home/deck/.local/bin/gamescope_sd"

then save and exit. An service override will be created.

Note: doesn't work with gamescope installed on distrobox

Ref: https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service

Distrobox

Create a container that can run gamescope without root

Ref

distrobox create gamescope --image ghcr.io/ublue-os/fedora-distrobox:latest --init-hooks "install -o 1000 -g 1000 -d /tmp/.X11-unix-new; mount --bind /tmp/.X11-unix-new /tmp/.X11-unix"
dsitrobox enter gamescope
sudo dnf install gamescope-3.14.2-1.fc40.x86_64
distrobox-export -b /usr/bin/gamescope
exit
~/.local/bin/gamescope

However, cannot use this binary as the GAMESCOPE_BIN in gamescope-session, would result in

vulkan: selecting physical device 'AMD Radeon 780M (RADV GFX1103_R1)': queue family 1 (general queue family 0)
vulkan: physical device supports DRM format modifiers
wlserver: [backend/headless/backend.c:67] Creating headless backend
wlserver: [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
wlserver: [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
wlserver: [libseat] [libseat/libseat.c:76] Backend 'logind' failed to open seat, skipping
wlserver: [libseat] [libseat/libseat.c:79] No backend was able to open a seat
wlserver: [backend/session/session.c:83] Unable to create seat: Function not implemented
wlserver: [backend/session/session.c:248] Failed to load session backend
wlserver: Failed to create session
Failed to initialize Wayland session
Failed to create backend.

I assume this is because the process inside distrobox cannot see host init processes

Add folders to lookup .so files

https://www.tecmint.com/understanding-shared-libraries-in-linux/

Add a new file in /etc/ld.so.conf.d for new paths, then run sudo ldconfig to refresh cache

(General linux ver) copy Steam games from other drive

If not using game mode, make sure you go to settings -> compatibility to choose a proton version as default.

Otherwise, Steam will think it cannot run Windows games and delete game files in common folder and and you will need to redownload them.

Downgrade built-in packages

ublue-os/bazzite#1914 (comment)

Example: downgrade ibus from 1.5.31 to 1.5.30

# Get an empty working folder
$ mkdir ibus-fix && cd ibus-fix

# Download packages
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-gtk2-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-gtk3-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-gtk4-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-libs-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/x86_64/ibus-panel-1.5.30-6.fc41.x86_64.rpm
$ wget https://kojipkgs.fedoraproject.org/packages/ibus/1.5.30/6.fc41/noarch/ibus-setup-1.5.30-6.fc41.noarch.rpm

# Perform downgrade
$ sudo rpm-ostree override replace * --remove ibus-xinit

# Reboot to apply changes
# Delete the `ibus-fix` folder if you want to

Goal

  1. No Emudeck
  2. No RetroArch, only standalone emus
  3. Steam Rom Manager to add games
    1. Tried Pegasus but games launched from it isn't considered a sub process by Steam (tried Mednaffe and mGBA)
      1. This issue only happens in Flatpak release
  4. Steam launches Pegasus in game mode
    1. Steam input support
      1. Easier to customize control since all controller profiles will be presented in one game (Pegasus)
    2. Don't need to add individual games
    3. Resolution override applies to all games

Steam Rom Manager

  1. Check if the EMU has template we can use
  2. Change title to {{Title}} so the original file name is kept
  3. Override artwork: by default it also overrides title, remember to delete it.

Steam Input

Currently Steam Input don't work with flatpak apps out of Game mode: ValveSoftware/steam-for-linux#10551

To configure gamepad, add emu to steam & launch emulator from game mode in order to grab controllers from Steam Input

Mednaffe

Flatpak install The UI and emu executable (mednafen) conflicts Handheld Daemon, need to disable it for all games. For these platforms Xbox controller is way more than enough so it should be fine.

(Copied from my old note:)

  1. Global Settings -> Sound -> Device: sexyal-literal-default
  2. Video -> Enable fullscreen, default driver: opengl
  3. Miscellaneous: Automatically load/save state on game load/save
  4. Input -> uncheck "Update physical...." a. This prevents joystick input while window is not in focus
  5. Key assignments: ?
    1. Seems no "Pause Menu" feature to access all emu functionalities via controller, everything has to bound to a key on keyboard or gamepad
    2. Currently mapped to keyboard and use Steam virtual keyboard
    3. If using rewind, need to manually toggle on every time you run emulator

System settings:

  1. Control: Launch Mednaffe with Steam so Gamepad device matches
  2. Graphics:
    1. System -> Correct the aspect ratio
    2. Windowed -> scale to x1 (easier to test in desktop mode)
    3. Fullscreen -> aspect
    4. Scale/Filter -> Interpolation 1, Special video scaler nny2x

Steam Rom manager

  1. Executable: /usr/bin/flatpak
  2. Arguments: run --command=mednafen com.github.AmatCoder.mednaffe "${filePath}"

Other reference: https://github.com/n1ckoates/steamdeck-emulation/blob/main/emulators/mednaffe.md

BizHawk

Benefit:

  1. Multi platform

  2. Can enable auto save/load, can rebind hotkeys.

  3. For DS, there's hotkey to swap layout. not usable since touch screen doesn't work in game mode

  4. Support --fullscreen option

  5. Download linux binary https://gitlab.com/TASVideos/BizHawk/-/pipelines/1407943455/ (or newer dev builds)

    1. it's still .exe because it's a C# (.net) project. We will use mono to run it.
  6. Create a fedora39 distrobox container and install runtime dependencies

 sudo dnf install glibc mono-complete lua lsb_release openal-soft gtk4
  1. bash EmuHawkMono.sh from the container

Note: 2.9.1 has major bug that would cause emu to freeze

  1. With default config, if I enable Autosave Last Slot or Autoload Last Slot, the emulator will freeze on game close or on game load when there's a state. (For load, I have confirmed the state on disk is good). a. If I disable View -> Display Messages, then both features work fine.
  2. Other observation:
    1. If I enable "Display Input", then resize the window during the game, the emulator will freeze
    2. If I enable messages, and manually save state, and resize the window before the save state message is gone, the emulator will freeze
    3. I can't reproduce this with Display FPS, so it seems only certain texts are causing the freeze.

"click the blue sillhouette below for onboarding" message

Set "FirstBoot": false in config.ini

Quit on closse Rom

There is no launch option similar to -batch in Duck station to close emu on close rom. However we can use a lua script:

while true do
    key=input.get();
    if key["Q"]==true then
        client.exit()
    end
    emu.frameadvance()
end

This will close EMU on pressing Q. It also actually saves state if Auto save is enabled (refer to Observation below regarding to force close)

Script for game mode

Create a BizHawk.sh

#!/bin/sh
distrobox enter bizhawk -- bash "$HOME/games/emu/BizHawk_devbuild/EmuHawkMono.sh" --fullscreen --lua="path/to/CloseEmuByQ.lua" "$@"

This script can then be used for Steam Rom Manager

/usr/bin/bash /path/to/script "${filepath}"

Observation:

  1. If closing the game from Steam Menu, auto save state won't kick in. Observed the same with Ctrl+C intruption
  2. N64: Bad performance
  3. NDS: touch screen doesn't work in game mode.

Pegasus FE

Need to use the build from EmuDeck https://github.com/dragoonDorise/pegasus-temp/ Official build requires runtime lib dependencies, had to use distrobox, but it doesn't launch host emulators in game mode (even though it works in desktop mode with distrobox-host-exec)

Problem: BizHawk AltF4 doesn't work in game mode.

Theme

https://github.com/ZagonAb/Flat-Ozone

Add shortName: (iconname) to metadata to show icon in collection list. Name is the file name under assets/systems. e.g. shortName: gba

Duck station

  1. Remove confirm on power off in option
  2. launch command: flatpak run org.duckstation.DuckStation -fullscreen -batch -resume -- "{file.path}"

chd CD format

To unpack chd format for unsupported EMUs, install MAME from Flatpak and run:

 flatpak run --command=chdman org.mamedev.MAME extractcd -i "/path/to/chd" -o "output.cue"

Flatpak: Need to grant access to folders if games are on external drives / SSDs

Dolphin

  1. No command line arg to start in fullscreen, default that in Graphic setting
  2. https://forums.launchbox-app.com/topic/43703-dolphin-please-confirm-box-when-exit-within-big-box/ remove confirm dialog on eit
  3. There's no command line option to quit after close rom, but we can assign quit button in hot key setting to achieve he same.
  4. Can assign WiiMote control scheme by game with game in tile -> right click -> properties -> Game config -> Editor
    [Controls]
    WiimoteProfile1=SonicSecretRing
    
  5. Controller profile is bound to joystick ID, hence, need to open it in game mode and rebind controller to steam virtual pad

PCSX2

There is auto save and load state feature. However, cli argunment doesn't support resume state https://forums.launchbox-app.com/topic/75069-configuring-launchbox-to-utliize-pcsx2-resume-save-states/

If we want this to work now we need to manuallly specify launch command for each game to point to each game's resume state file (constructed by game ID and CRC), might not worth the trouble? Manuall save/load state is easier for now.

Flatpak: Need to grant access to folders if games are on external drives / SSDs

PPSSPP

To convert chd

flatpak run --command=chdman org.mamedev.MAME createdvd -hs 2048 -i "input.iso" -o "output.chd"

to avoid bad CHD file warning. See hrydgard/ppsspp#18925

Melon DS

Flatpak: Need to grant access to folders if games are on external drives / SSDs

Rosalie's Mupen GUI

Flatpak: Need to grant access to folders if games are on external drives / SSDs

Monster Hunter Wilds

Broken UI display

https://www.reddit.com/r/linux_gaming/comments/1j1fupc/ui_display_bug_in_mh_wilds/

Fixed by changing config.ini

TextureLoadLevelBias=0

Ref: https://www.reddit.com/r/linux_gaming/comments/1j1fupc/comment/mgr11ck/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

General info:

https://www.reddit.com/r/linux_gaming/comments/1j1fupc/comment/mfjbwqw/ There's separate mesa and dxvck cache outside steam (however the post doesn't explain how to flush them, need further research)

Also found that the monster icon in quest information tab is broken when selecting quests, fixed by copying options in config.ini from laptop. One or more of the following should be responsible:

GIPointCloudMinLod=0
AllowMeshShader=Enable
EffectRayTracingVolume=0
ShrinkShadowmapFilterSampleWidthMax=64
ShadowCacheEnable=False
RayTracingGIEnable=false
RayTracingReflectionEnable=false
RayTracingShadowEnable=false
RayTracingTransparentEnable=false

Spec: 2023 model, 7840U, 32G Ram, 2TB SSD

GPD Win 4: Del to bios, make sure secure boot is off. F7 to access boot menu

By default it creates a 300GB partition for Windows and the most of the rest as D:, we will replace D: with Linux.

Joystick dead zone fix https://www.reddit.com/r/gpdwin/comments/16oz9zp/gpd_win_4_deadzone_fix_posted_to_discord/

Useful tools & Some Bazzite specific guides https://github.com/aarron-lee/gpd-win-tricks

Apply the suspend fix https://github.com/aarron-lee/gpd-win-tricks?tab=readme-ov-file#recommended-settings-to-change-in-game-mode

Enable secure boot mode, need Custom mode? https://www.google.com/search?q=secure+boot+mode+standard+or+custom+&client=firefox-b-d&sca_esv=ecca4e17a2edffed&ei=g_GxZrz8AqvM1e8PueKBkAg&ved=0ahUKEwj8ybebi-CHAxUrZvUHHTlxAIIQ4dUDCBA&uact=5&oq=secure+boot+mode+standard+or+custom+&gs_lp=Egxnd3Mtd2l6LXNlcnAiJHNlY3VyZSBib290IG1vZGUgc3RhbmRhcmQgb3IgY3VzdG9tIDIKEAAYgAQYQxiKBTIFEAAYgAQyBBAAGB4yBBAAGB4yBBAAGB4yBBAAGB4yCBAAGIAEGKIEMggQABiABBiiBDIGEAAYBRgeMgYQABgFGB5I4A5QjwpYjwpwAngAkAEAmAE0oAFoqgEBMrgBA8gBAPgBAZgCA6ACPcICChAAGLADGNYEGEeYAwCIBgGQBgqSBwEzoAf-Cg&sclient=gws-wiz-serp

Debloat Win11 Home

https://github.com/Raphire/Win11Debloat

Desktop mode in Game mode

Since there's physical keyboard, it would be ideal to be able to run desktop mode with fcitx IME support so we can open browser in game mode

The built-in screen is quite small so I also need 150% scaling.

  1. Copy /usr/bin/steamos-nested-desktop to somewhere (e.g. ~/scripts/steamos-nested-desktop)
  2. Modify kwin_wayland_wrapper command to
    /usr/bin/kwin_wayland_wrapper --width ${STEAMOS_NESTED_DESKTOP_WIDTH:-1280} --height ${STEAMOS_NESTED_DESKTOP_HEIGHT:-800} --scale ${STEAMOS_NESTED_DESKTOP_SCALE:-1} --no-lockscreen \$@
    
  3. Set the script to executable, add to Steam
  4. Set launch option
    XMODIFIERS=@im=fcitx MOZ_ENABLE_WAYLAND=1 STEAMOS_NESTED_DESKTOP_WIDTH=1920 STEAMOS_NESTED_DESKTOP_HEIGHT=1080 STEAMOS_NESTED_DESKTOP_SCALE=0.75
    
  5. Profit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment