From a0bc385765494937672b3553f2657b7dbe4e1317 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Wed, 23 Sep 2026 14:46:45 +0200 Subject: [PATCH] fix: Add single user no password option with SDDM, fetch newest Vapor presets - One wizard question: "single user, no password, like SteamOS" switches to SDDM (autologin via CachyOS's own steam-set-session, no workarounds) and removes lock screen, user switching and log out (launcher shows only Sleep/Restart/Shut Down; Meta+L and Ctrl+Alt+Del unbound). Declining keeps the current login manager and KDE's defaults - Look up the newest steamdeck-kde-presets from Valve's release repos and verify its SHA-256; take over the new SteamOS 3.9 defaults - Restart plasmashell through systemd so the desktop keeps the session's dark theme; drop the bundled icon in favour of Valve's and Steam's - README and AGENTS.md updated --- AGENTS.md | 16 +++++- README.md | 78 +++++++++++++++++++++------- lib/common.sh | 12 +++++ lib/desktop-shortcut.sh | 32 +++++++----- lib/login-manager.sh | 112 ++++++++++++++++++++++++++++++++++++---- lib/steam-desktop.sh | 71 ++++++++++++++++++++++++- lib/vapor-theme.sh | 5 +- setup-gamescope-boot.sh | 25 +++++---- 8 files changed, 298 insertions(+), 53 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8972698..c209bf4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +41,19 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine ## Non-obvious behaviour to preserve +- One wizard question in `choose_setup_mode` sets `$SINGLE_USER` and + `$LOGIN_MANAGER`. "Single user, no password" = SteamOS: SDDM plus no lock + screen, user switching or log out (`setup_single_user`; the launcher's + Session dropdown is hidden via kickoff `primaryActions=3` because + restricting `action/logout` also hides Restart/Shut Down). Otherwise the + current login manager stays. Two login-manager paths: + **sddm** (like SteamOS: `steam-set-session` writes + `/etc/sddm.conf.d/zz-steamos-autologin.conf`, which SDDM honours; we add + `User=`/`Relogin=` in `10-gamescope-autologin.conf`, and `/etc/sddm.conf` + must not contain `[Autologin]` since it's read last) and **plasmalogin** + (needs the sync bridge and the shortcut's sudoers rule). Both must keep + working. + - `steam-set-session` only writes `/etc/plasmalogin.conf.d/zz-steamos-autologin.conf`; the base `/etc/plasmalogin.conf` wins, hence the sync bridge. The sync service needs `StartLimitIntervalSec=0`, or bursts of session switches @@ -83,7 +96,8 @@ Behaviour is best verified in a CachyOS VM (QEMU/KVM, KDE Plasma install, runs. Notes from doing this: - Run the script non-interactively by piping answers, e.g. - `printf "\ny\nn\n" | ./setup-gamescope-boot.sh` (user, theme, reboot). + `printf "\ny\nn\nn\n" | ./setup-gamescope-boot.sh` (user, single user, + theme, reboot). The prompt order depends on what's already installed. - Over SSH, export the session environment before running it so the live Plasma steps work: diff --git a/README.md b/README.md index 2f52008..3ffc8fe 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ script fixes that and sets everything up for you. ## What you get -- **Boots into gaming mode** automatically, without a login screen. +- **Boots into gaming mode** automatically - you never see a login screen, + just like SteamOS. - **Switch to Desktop** from Steam's power menu works, and so does going back: use the **Return to Gaming Mode** icon on the desktop, or just log out. @@ -37,8 +38,19 @@ cd ``` Run it as yourself, not as root. It asks for your password once, then asks a -few yes/no questions (whether to install missing packages, the SteamOS look, -and the LED driver on a Steam Machine). At the end it offers to restart. +few yes/no questions: + +- **Single user, no password, like SteamOS?** Recommended for a console. + You never see a login or lock screen, and there's no user switching or + logging out - typing a password with a controller is no fun. This + switches to SDDM, the login manager SteamOS uses. Say no to keep + CachyOS's default login manager and KDE's normal lock screen; gaming mode + still starts automatically. +- whether to install missing packages; +- the LED driver (Steam Machine only) and the SteamOS look. + +At the end it offers to restart. The switch to SDDM takes effect from that +restart. Keep the whole folder: the script needs the files in `lib/` next to it. @@ -49,7 +61,7 @@ It's safe to run again later, for example after a CachyOS update. - **To the desktop:** in gaming mode, open the Steam menu and choose **Power > Switch to Desktop**. - **Back to gaming mode:** double-click **Return to Gaming Mode** on the - desktop, or log out. + desktop (or log out, if you didn't choose single user). - After a restart you always start in gaming mode. Prefer to decide yourself where your PC starts? Run one of these in Konsole: @@ -65,7 +77,7 @@ steamos-session-select oneshot # always start in gaming mode (default) **Ctrl+Alt+F3**, log in with your username and password, and run: ```bash -steamos-session-select plasma && sudo systemctl restart plasmalogin +sudo /usr/lib/steamos/steam-set-session plasma.desktop && sudo systemctl restart display-manager ``` That takes you back to the desktop. @@ -84,7 +96,34 @@ To remove everything the script set up, see ## Technical details -### Why this is needed +### Single user: SDDM, no locking + +The wizard's first question. Answering yes switches to **SDDM** and turns +off everything that asks for a password or another user, per user and +without touching system files: `action/lock_screen`, `switch_user` and +`start_new_session` restrictions in `kdeglobals`, no automatic locking +(`kscreenlockerrc`), Meta+L and Ctrl+Alt+Del unbound, and the launcher shows +only Sleep / Restart / Shut Down (kickoff `primaryActions=3`), which hides +the Session dropdown with Log Out. (Restricting `action/logout` would also +hide Restart and Shut Down.) Answering no restores KDE's defaults and keeps +the current login manager. + +**SDDM** is what SteamOS uses, and CachyOS's +`steam-set-session` supports it directly: it writes +`/etc/sddm.conf.d/zz-steamos-autologin.conf`, which SDDM honours. The script +installs and enables `sddm` (disabling the current display manager, active +from the next boot), writes `User=`, `Session=` and `Relogin=true` to +`/etc/sddm.conf.d/10-gamescope-autologin.conf`, and removes any +`[Autologin]` from `/etc/sddm.conf` (read last, so it would override both). +No sync bridge or sudoers rule is needed; the shortcut just runs +`steamos-session-select gamescope`, which logs out, and `Relogin=true` +logs straight back in to gamescope. Switching an existing +plasma-login-manager setup to SDDM removes the sync bridge. + +Keeping **plasma-login-manager** (CachyOS's default since March 2026) needs +the workarounds below. + +### Why this is needed (plasma-login-manager) CachyOS's `gamescope-session-cachyos` package ships `steamos-session-select`, which is meant to work exactly like it does on real SteamOS. Since the March @@ -117,15 +156,16 @@ tools write to the conf.d fragment into the base config. In order: -1. Checks the display manager (warns if it isn't `plasma-login-manager`) and - that it runs as the user that should autologin. +1. Checks that it runs as the user that should autologin, and asks whether + to switch to SDDM (see above). 2. Installs missing packages: `gamescope-session-cachyos`, `steam`, `mangohud`, `xterm`, `ttf-liberation`, `wqy-zenhei`, `plasma-keyboard`. -3. Creates `/etc/plasmalogin.conf.d`, backs up and rewrites the +3. *SDDM:* installs/enables SDDM and writes its autologin config. + *plasma-login-manager:* creates `/etc/plasmalogin.conf.d`, backs up and rewrites the `[Autologin]` section of `/etc/plasmalogin.conf`, and removes stray `zzz-steamos-autologin*.conf` files from manual troubleshooting (never `zz-steamos-autologin.conf`, which CachyOS's tools own). -4. Installs `/usr/local/bin/sync-steamos-session.sh` plus +4. *plasma-login-manager only:* installs `/usr/local/bin/sync-steamos-session.sh` plus `sync-steamos-session.path`/`.service`, which keep the base config in sync with session switches. 5. Sets up Steam for the desktop: `STEAM_GAMEPADUI_ARGS="-gamepadui -steamos3"` @@ -134,9 +174,9 @@ In order: that starts Steam silently in Plasma only. 6. *(Steam Machine, optional)* the LED driver - see below. 7. *(Optional)* the SteamOS desktop look - see below. -8. Creates the **Return to Gaming Mode** shortcut, with a narrow sudoers rule - (`/etc/sudoers.d/gamescope-session-switch`) so it can restart the login - manager without a password prompt. +8. Creates the **Return to Gaming Mode** shortcut. On plasma-login-manager it + also adds a narrow sudoers rule (`/etc/sudoers.d/gamescope-session-switch`) + so it can restart the login manager without a password prompt. Re-running doesn't duplicate any settings. Every system file it modifies is backed up once, next to the original, with a `.bak-gamescope-wizard` suffix. @@ -216,7 +256,11 @@ immediately, which can turn into a loop - hence the Ctrl+Alt+F3 escape above. ### Removing everything ```bash -# restore the original login config +# SDDM: go back to plasma-login-manager +sudo rm /etc/sddm.conf.d/10-gamescope-autologin.conf +sudo systemctl disable sddm && sudo systemctl enable plasmalogin + +# plasma-login-manager: restore the original login config sudo cp /etc/plasmalogin.conf.bak-gamescope-wizard /etc/plasmalogin.conf # session sync watcher @@ -248,7 +292,7 @@ sudo pacman -R leds-valve-dkms-git | `setup-gamescope-boot.sh` | Entry point: user and sudo checks, step order, summary, reboot | | `lib/common.sh` | Output helpers, yes/no prompts, backups | | `lib/packages.sh` | Required packages, AUR helper (yay/paru) | -| `lib/login-manager.sh` | plasmalogin autologin, session sync bridge and its systemd units | +| `lib/login-manager.sh` | SDDM or plasmalogin choice and autologin, session sync bridge | | `lib/steam-desktop.sh` | Steam in the Plasma session: gamepad UI flags, virtual keyboard, autostart | | `lib/led-driver.sh` | Fremont detection, kernel headers, LED driver, OpenRGB | | `lib/vapor-theme.sh` | Vapor theme, Valve's SteamOS defaults, panel, dark mode | @@ -263,9 +307,7 @@ Notes for contributors and AI coding agents are in [`AGENTS.md`](AGENTS.md). become unnecessary - please open an issue or PR if you notice that. - Tested on a Valve Steam Machine running CachyOS Desktop edition. It should work on any CachyOS desktop install using `plasma-login-manager`, but - hasn't been tested on Steam Deck/Legion Go hardware, which typically use - SDDM. With another display manager the script warns and asks before - continuing. + hasn't been tested on Steam Deck/Legion Go hardware. ### Related upstream reports diff --git a/lib/common.sh b/lib/common.sh index 3dc9679..3167a32 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -26,6 +26,18 @@ require_root_helper() { fi } +plasma_applets() { + # Print "containment:applet" for every applet of plugin $1 in the + # user's Plasma layout, for kwriteconfig6 --group paths. + local conf="$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" + [[ -f "$conf" ]] || return 0 + awk -v plugin="$1" ' + /^\[Containments\]\[[0-9]+\]\[Applets\]\[[0-9]+\]$/ { split($0, p, /[][]+/); sect = p[3] ":" p[5] } + /^\[/ && !/\]\[Applets\]\[[0-9]+\]$/ { sect = "" } + $0 == "plugin=" plugin && sect != "" { print sect } + ' "$conf" +} + backup_file() { local f="$1" if [[ -f "$f" && ! -f "${f}.bak-gamescope-wizard" ]]; then diff --git a/lib/desktop-shortcut.sh b/lib/desktop-shortcut.sh index 42c9b87..49c6f60 100644 --- a/lib/desktop-shortcut.sh +++ b/lib/desktop-shortcut.sh @@ -17,21 +17,29 @@ create_desktop_shortcut() { mkdir -p "$desktop_dir" - # Let the shortcut restart the login manager without a password prompt - # (it runs with Terminal=false, so sudo can't ask). Scoped to exactly - # the two commands the shortcut needs, for this user only. - local sudoers_tmp - sudoers_tmp="$(mktemp)" - cat > "$sudoers_tmp" << EOF + # On SDDM, steamos-session-select logging out is enough: Relogin=true + # logs straight back in to the newly selected session, like SteamOS. + # plasma-login-manager needs the sync bridge run and a restart, which + # the shortcut can't sudo for interactively (Terminal=false), so it gets + # a password-less rule scoped to exactly those two commands. + local exec_line="steamos-session-select gamescope" + if [[ "$LOGIN_MANAGER" == "plasmalogin" ]]; then + exec_line="sh -c 'steamos-session-select gamescope && sudo -n /usr/bin/systemctl start sync-steamos-session.service && sudo -n /usr/bin/systemctl restart plasmalogin'" + local sudoers_tmp + sudoers_tmp="$(mktemp)" + cat > "$sudoers_tmp" << EOF $TARGET_USER ALL=(root) NOPASSWD: /usr/bin/systemctl start sync-steamos-session.service, /usr/bin/systemctl restart plasmalogin EOF - if sudo visudo -cf "$sudoers_tmp" >/dev/null; then - sudo install -m 0440 -o root -g root "$sudoers_tmp" /etc/sudoers.d/gamescope-session-switch - ok "Installed /etc/sudoers.d/gamescope-session-switch for the shortcut." + if sudo visudo -cf "$sudoers_tmp" >/dev/null; then + sudo install -m 0440 -o root -g root "$sudoers_tmp" /etc/sudoers.d/gamescope-session-switch + ok "Installed /etc/sudoers.d/gamescope-session-switch for the shortcut." + else + warn "Generated sudoers rule failed validation; the shortcut will not be able to restart plasmalogin." + fi + rm -f "$sudoers_tmp" else - warn "Generated sudoers rule failed validation; the shortcut will not be able to restart plasmalogin." + sudo rm -f /etc/sudoers.d/gamescope-session-switch fi - rm -f "$sudoers_tmp" # SteamOS itself uses Valve's "gaming-return" icon (Steam logo with a # return arrow; the Deck-style arrow is only used on Steam Deck @@ -48,7 +56,7 @@ EOF [Desktop Entry] Name=Return to Gaming Mode Comment=Switch session back to Gamescope -Exec=sh -c 'steamos-session-select gamescope && sudo -n /usr/bin/systemctl start sync-steamos-session.service && sudo -n /usr/bin/systemctl restart plasmalogin' +Exec=$exec_line Icon=$shortcut_icon Terminal=false Type=Application diff --git a/lib/login-manager.sh b/lib/login-manager.sh index 90ab74a..b0b8d9b 100644 --- a/lib/login-manager.sh +++ b/lib/login-manager.sh @@ -4,21 +4,113 @@ BASE_CONF="/etc/plasmalogin.conf" -check_display_manager() { - # Step 1: warn when the login manager is not plasma-login-manager. - local DM - DM="$(systemctl show -p Id --value display-manager 2>/dev/null | sed 's/\.service$//')" - info "Detected display manager: ${DM:-none}" +choose_setup_mode() { + # Step 1: one question decides both the login manager and locking. + # "Single user, no password" is SteamOS: SDDM (which CachyOS's session + # tools support directly, no workarounds) plus no lock screen, user + # switching or log out. Otherwise keep the current login manager + # (CachyOS's default plasma-login-manager gets the sync bridge below) + # and KDE's normal locking. Sets SINGLE_USER and LOGIN_MANAGER. + local current + current="$(systemctl show -p Id --value display-manager 2>/dev/null | sed 's/\.service$//')" + info "Detected display manager: ${current:-none}" - if [[ "$DM" != "plasmalogin" ]]; then - warn "This wizard was built and tested against plasma-login-manager (plasmalogin)." - warn "Detected display manager is '${DM:-unknown}'. SDDM setups don't need" - warn "most of these workarounds (SDDM's own Autologin works out of the box);" - warn "this script will still try, but review the output carefully." + echo "SteamOS is a single-user console without passwords: no login screen, no" + echo "lock screen, no user switching or logging out - typing a password with a" + echo "controller is no fun. It uses the SDDM login manager for that." + if ask_yn "Single user, no password, like SteamOS? (switches to SDDM)" y; then + SINGLE_USER=true + LOGIN_MANAGER="sddm" + return + fi + + SINGLE_USER=false + if [[ "$current" == "sddm" ]]; then + LOGIN_MANAGER="sddm" + return + fi + LOGIN_MANAGER="plasmalogin" + if [[ "$current" != "plasmalogin" ]]; then + warn "The workarounds are built for plasma-login-manager, but '${current:-unknown}' is active." ask_yn "Continue anyway?" n || exit 0 fi } +setup_login_manager() { + # Steps 3-8 for whichever login manager was chosen in step 1. + case "$LOGIN_MANAGER" in + sddm) + switch_to_sddm || exit 1 + configure_sddm_autologin + remove_session_sync + ;; + plasmalogin) + configure_autologin + install_session_sync + ;; + esac +} + +switch_to_sddm() { + # Takes effect at the next boot; the running session is left alone. + info "Installing and enabling SDDM..." + sudo pacman -S --needed --noconfirm sddm || { err "Installing sddm failed."; return 1; } + local current + current="$(systemctl show -p Id --value display-manager 2>/dev/null)" + if [[ -n "$current" && "$current" != "sddm.service" ]]; then + sudo systemctl disable "$current" + fi + sudo systemctl enable -f sddm.service || { err "Enabling sddm failed."; return 1; } + ok "SDDM is the login manager from the next boot on." + echo +} + +configure_sddm_autologin() { + # User= and Relogin= live in our own fragment; steam-set-session keeps + # Session= up to date in zz-steamos-autologin.conf, which sorts later + # and so wins. /etc/sddm.conf is read last, so any [Autologin] there + # would override both and is removed. + local conf="/etc/sddm.conf.d/10-gamescope-autologin.conf" + info "Configuring SDDM autologin for $TARGET_USER into gamescope (Relogin=true)" + sudo mkdir -p /etc/sddm.conf.d + sudo tee "$conf" > /dev/null << EOF +[Autologin] +User=$TARGET_USER +Session=gamescope-session.desktop +Relogin=true +EOF + + if [[ -f /etc/sddm.conf ]] && grep -q '^\[Autologin\]' /etc/sddm.conf; then + backup_file /etc/sddm.conf + sudo awk ' + /^\[Autologin\]/ { skip=1; next } + /^\[/ { skip=0 } + !skip { print } + ' /etc/sddm.conf | sudo tee /etc/sddm.conf.tmp > /dev/null && + sudo mv /etc/sddm.conf.tmp /etc/sddm.conf + info "Removed [Autologin] from /etc/sddm.conf (backup kept)." + fi + + # Start in gamescope, through CachyOS's own tool so its file is current. + sudo /usr/lib/steamos/steam-set-session gamescope-session.desktop + + ok "SDDM autologin configured:" + cat "$conf" + echo +} + +remove_session_sync() { + # The plasmalogin sync bridge from an earlier run isn't needed on SDDM. + if [[ -f /etc/systemd/system/sync-steamos-session.path ]]; then + info "Removing the plasma-login-manager sync bridge (not needed with SDDM)..." + sudo systemctl disable --now sync-steamos-session.path 2>/dev/null + sudo rm -f /etc/systemd/system/sync-steamos-session.path \ + /etc/systemd/system/sync-steamos-session.service \ + /usr/local/bin/sync-steamos-session.sh + sudo systemctl daemon-reload + fi +} + configure_autologin() { # Steps 3-5: plasmalogin.conf.d, the base [Autologin] section, stray fragments. # 3. Ensure plasmalogin.conf.d exists (fixes Switch-to-Desktop crash) diff --git a/lib/steam-desktop.sh b/lib/steam-desktop.sh index deabc51..7b81683 100644 --- a/lib/steam-desktop.sh +++ b/lib/steam-desktop.sh @@ -1,5 +1,6 @@ #!/bin/bash -# Steam in the Plasma desktop session: gamepad UI args, virtual keyboard, autostart. +# Steam in the Plasma desktop session: gamepad UI args, virtual keyboard, +# autostart, and no screen locking (like SteamOS). # Sourced by setup-gamescope-boot.sh; not meant to be run on its own. setup_steam_desktop() { @@ -52,3 +53,71 @@ EOF ok "Steam UI parameters and keyboard autostart deployed successfully." } + +setup_single_user() { + # With SINGLE_USER (chosen in step 1), like SteamOS: one user and no + # password prompts, since typing a password with a controller is + # miserable. Hides Lock / Switch User / Log Out + # everywhere (launcher, Meta+L, Ctrl+Alt+Del) and never locks on idle or + # resume; "Return to Gaming Mode" is the way out of the desktop. Declining + # restores KDE's defaults. + local action allow=true + [[ "$SINGLE_USER" == true ]] && allow=false + for action in lock_screen switch_user start_new_session; do + kwriteconfig6 --file kdeglobals --group "KDE Action Restrictions" --key "action/$action" "$allow" + done + if [[ "$allow" == false ]]; then + kwriteconfig6 --file kscreenlockerrc --group Daemon --key Autolock false + kwriteconfig6 --file kscreenlockerrc --group Daemon --key LockOnResume false + kwriteconfig6 --file kscreenlockerrc --group Daemon --key Timeout 0 + # The action restriction hides Lock in menus but not the Meta+L + # shortcut; unbind it (format: current,default,description). + kwriteconfig6 --file kglobalshortcutsrc --group ksmserver --key "Lock Session" \ + $'none,Screensaver\tMeta+L,Lock Session' + kwriteconfig6 --file kglobalshortcutsrc --group ksmserver --key "Log Out" \ + 'none,Ctrl+Alt+Del,Show Logout Screen' + set_launcher_leave_buttons single + ok "Screen locking, user switching and logging out disabled." + else + kwriteconfig6 --file kscreenlockerrc --group Daemon --key Autolock --delete + kwriteconfig6 --file kscreenlockerrc --group Daemon --key LockOnResume --delete + kwriteconfig6 --file kscreenlockerrc --group Daemon --key Timeout --delete + kwriteconfig6 --file kglobalshortcutsrc --group ksmserver --key "Lock Session" \ + $'Screensaver\tMeta+L,Screensaver\tMeta+L,Lock Session' + kwriteconfig6 --file kglobalshortcutsrc --group ksmserver --key "Log Out" \ + 'Ctrl+Alt+Del,Ctrl+Alt+Del,Show Logout Screen' + set_launcher_leave_buttons default + ok "Keeping KDE's normal screen locking and user switching." + fi +} + +set_launcher_leave_buttons() { + # "single": only Sleep / Restart / Shut Down buttons in the launcher, no + # Session dropdown (that's where Log Out lives). Restricting the + # "logout" action instead would also hide Restart and Shut Down. + # "default": Plasma's own buttons. + local mode="$1" applet + for applet in $(plasma_applets org.kde.plasma.kickoff); do + local -a grp=(--file plasma-org.kde.plasma.desktop-appletsrc --group Containments + --group "${applet%%:*}" --group Applets --group "${applet#*:}" + --group Configuration --group General) + if [[ "$mode" == single ]]; then + kwriteconfig6 "${grp[@]}" --key primaryActions 3 + kwriteconfig6 "${grp[@]}" --key systemFavorites 'suspend,reboot,shutdown' + else + kwriteconfig6 "${grp[@]}" --key primaryActions --delete + kwriteconfig6 "${grp[@]}" --key systemFavorites --delete + fi + done + if pgrep -u "$USER" -x plasmashell >/dev/null; then + local js + if [[ "$mode" == single ]]; then + js="w.writeConfig('primaryActions', 3); w.writeConfig('systemFavorites', 'suspend,reboot,shutdown');" + else + js="w.writeConfig('primaryActions', 0); w.writeConfig('systemFavorites', 'suspend,hibernate,reboot,shutdown');" + fi + qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript \ + "panels().forEach(function (p) { p.widgets('org.kde.plasma.kickoff').forEach(function (w) { w.currentConfigGroup = ['General']; $js w.reloadConfig(); }); })" \ + >/dev/null 2>&1 || true + fi +} diff --git a/lib/vapor-theme.sh b/lib/vapor-theme.sh index 4dcbd5e..dad7ea1 100644 --- a/lib/vapor-theme.sh +++ b/lib/vapor-theme.sh @@ -103,12 +103,13 @@ install_vapor_theme() { [[ -d "${tmp_dir}/usr/share/plasma/avatars" ]] && cp -r "${tmp_dir}/usr/share/plasma/avatars/"* ~/.local/share/plasma/avatars/ # Valve's SteamOS desktop defaults (fonts, Steam keyboard window rule, - # no screen locking, no welcome screen, light file indexing, GTK theme). + # no welcome screen, light file indexing, GTK theme). # Left out on purpose: autostart entries (Steam is started by our user # unit), sddm/profile.d, and files hardcoding /home/deck or SteamOS tools. info "Applying SteamOS desktop defaults..." local f - for f in kdeglobals kwinrc kwinrulesrc kscreenlockerrc kded5rc baloofilerc kcminputrc; do + # kscreenlockerrc is left to the single-user question. + for f in kdeglobals kwinrc kwinrulesrc kded5rc baloofilerc kcminputrc; do [[ -f "${tmp_dir}/etc/xdg/$f" ]] && merge_kde_config "${tmp_dir}/etc/xdg/$f" "$f" done [[ -f "${tmp_dir}/etc/xdg/kded5rc" ]] && merge_kde_config "${tmp_dir}/etc/xdg/kded5rc" kded6rc diff --git a/setup-gamescope-boot.sh b/setup-gamescope-boot.sh index 7c4a908..b13e4f6 100755 --- a/setup-gamescope-boot.sh +++ b/setup-gamescope-boot.sh @@ -80,18 +80,20 @@ fi ok "Using user: $TARGET_USER" echo -check_display_manager +choose_setup_mode echo install_required_packages echo -configure_autologin -install_session_sync +setup_login_manager setup_steam_desktop echo +setup_single_user +echo + setup_led_driver setup_vapor_theme @@ -105,16 +107,21 @@ echo echo -e "${c_bold}Setup complete.${c_reset}" echo "What this did:" echo " - Installed gamescope-session-cachyos, steam, mangohud and friends (if missing)" -echo " - Created /etc/plasmalogin.conf.d (fixes Switch-to-Desktop crash)" -echo " - Set $BASE_CONF to autologin '$TARGET_USER' into gamescope, with Relogin=true" -echo " - Installed a sync bridge + systemd watcher so Steam's Switch-to-Desktop" -echo " (and cachyos-gamescope-autologin.service resetting back to gamescope" -echo " on logout) both actually take effect" +if [[ "$LOGIN_MANAGER" == "sddm" ]]; then + echo " - Made SDDM the login manager, autologging '$TARGET_USER' into gamescope" + echo " with Relogin=true, like SteamOS (active from the next boot)" +else + echo " - Created /etc/plasmalogin.conf.d (fixes Switch-to-Desktop crash)" + echo " - Set $BASE_CONF to autologin '$TARGET_USER' into gamescope, with Relogin=true" + echo " - Installed a sync bridge + systemd watcher so Steam's Switch-to-Desktop" + echo " (and cachyos-gamescope-autologin.service resetting back to gamescope" + echo " on logout) both actually take effect" + echo " - Added /etc/sudoers.d/gamescope-session-switch so the desktop shortcut works" +fi echo " - Configured permanent silent Steam autostart so Steam+X works everywhere" echo " - Injected -steamos3 flag to force original Steam Deck overlay glyphs" echo " - Optionally installed Valve's Vapor (Steam Deck) KDE theme, if you chose to" echo " - On Valve Fremont hardware, optionally set up the leds-valve front LED bar driver" -echo " - Added /etc/sudoers.d/gamescope-session-switch so the desktop shortcut works" echo echo "Backups of any files this script modified were saved with a" echo ".bak-gamescope-wizard suffix next to the original."