switch-to-gaming masks sleep/suspend/hibernate targets with --runtime
(symlinks in /run/systemd/system/). switch-to-desktop's plain `unmask`
plus a missing daemon-reload left logind's CanSuspend cache stale, so
`systemctl suspend` returned polkit "Access denied" back on desktop.
Add the --runtime unmask and a daemon-reload, plus matching NOPASSWD
sudoers entries so the desktop-side script can actually run them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Symptom: after exiting Gaming Mode (Super+Shift+R or Steam→Power→Switch
to Desktop) the laptop stayed pinned at CPU governor=performance and
power profile=performance until manually reset. Drained battery, ran hot.
Root causes:
- The wrapper's trap-based restore raced with `systemctl restart sddm`
in switch-to-desktop. SDDM teardown could SIGKILL the wrapper before
`restore_balanced_mode` finished its writes.
- restore_balanced_mode hardcoded "powersave" / "balanced" — wrong on
systems whose default is schedutil or power-saver.
- powerprofilesctl was called without sudo and without a polkit auth
rule, so it silently failed when the session had no auth agent.
Fix:
- On entry, gamescope-session-nm-wrapper writes the user's actual
pre-Gaming-Mode CPU governor + power profile to ~/.cache/deckshift/
saved-state.
- On exit, switch-to-desktop reads that file FIRST (synchronous, before
any pkill / sddm-restart) and applies the restore. Wrapper's trap
still runs as a backup.
- Restore reads from the saved-state file rather than guessing.
- powerprofilesctl is now invoked via `sudo -n` and added to the
NOPASSWD allowlist (%video ALL=(ALL) NOPASSWD: powerprofilesctl set *)
so the call always succeeds without a polkit prompt.
Verified on Acer Nitro (AMD APU + NVIDIA hybrid):
Before: stuck at performance/performance after exit.
After: back to powersave/balanced on Switch-to-Desktop, both via the
synchronous restore in switch-to-desktop and the wrapper trap.
Settings TUI (bin/deckshift-settings):
- Don't crash when the saved OUTPUT_CONNECTOR is no longer plugged in
(stale connector → empty mode list → grep + pipefail killed the script)
- Add [hybrid-nvidia] GPU mode for NVIDIA dGPU + AMD/Intel iGPU laptops:
sets __NV_PRIME_RENDER_OFFLOAD / __VK_LAYER_NV_optimus / __GLX_VENDOR_LIBRARY_NAME
so games inside gamescope render on NVIDIA while gamescope itself runs on
the iGPU (necessary on hybrid laptops where eDP is wired to the iGPU)
- Add [hybrid-amd] GPU mode for AMD dGPU + AMD/Intel iGPU laptops: sub-menu
to pick the dGPU, then sets DRI_PRIME + MESA_VK_DEVICE_SELECT
- Single GPU-mode line in the status panel covering all five states
(auto / NVIDIA direct / AMD direct / hybrid-nvidia / hybrid-amd)
- Switch GPU selection to clear-then-set so mode-switching never leaves
stale flags behind
Installer (deckshift.sh):
- Drop monitor / resolution / refresh selection from the installer entirely;
display keys are owned by the TUI now. Avoids stale OUTPUT_CONNECTOR
values when the configured display is later unplugged
- Switch gamescope-session-plus.conf writer from heredoc-overwrite to
per-key set/unset (sed-based, mirrors flush_pending in the TUI) so the
installer is idempotent and re-runs preserve user-set display values
- Strip stale opposite-GPU keys when re-running on a changed GPU
(e.g. NVIDIA → AMD swap clears VULKAN_ADAPTER / GBM_BACKEND)
- Fix switch-to-desktop: replace racy `stop sddm` + disowned `start sddm`
with a single atomic `systemctl restart sddm`. The disowned start was
getting killed by user-session teardown before SDDM came back up,
leaving the user on a black screen after Super+Shift+R
Two issues found during first-run-machine test:
- Steam was installed but never auto-launched, so the first-run client
update never happened — Gaming Mode failed to enter Big Picture
cleanly. Now follows omarchy-install-gaming-steam's pattern: setsid
gtk-launch steam &, disown, runs in parallel with the rest of the
install.
- Walker didn't pick up the deckshift-settings.desktop entry until the
next manual elephant restart. setup_settings_tui now calls
omarchy-restart-walker after update-desktop-database, which restarts
elephant.service + the walker autostart unit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Steam Deck-style gaming mode for Linux + Hyprland. Lineage:
Super-Shift-S-Omarchy-Deck-Mode → Omarchy Deck → DeckShift (renamed for
distro-portability — distro-agnostic features on the roadmap).
Currently targets Omarchy (Arch + Hyprland + SDDM + iwd). Includes:
- Press Super+Shift+S to enter Gaming Mode (Gamescope + Steam Big
Picture), Super+Shift+R to return to desktop
- NVIDIA GSP-aware driver branch selection (legacy nvidia-580xx-utils
for Maxwell/Pascal/Volta cards)
- AMD support (vulkan-radeon, libvdpau)
- Intel support (vulkan-intel, intel-media-driver) with generation-aware
performance warning before continuing
- Idempotent package installs via Omarchy's omarchy-pkg-add
- Optional Xbox Bluetooth controller support (xpadneo-dkms)
- Settings TUI launched from Walker (deckshift-settings) for adjusting
monitor / GPU / resolution / refresh rate after install:
* Buffered changes — explicit Save and exit / Cancel
* hyprctl-based mode detection with monitor-capability filtering
* Save-time warning if values exceed monitor capability
* Esc returns to main menu without crashing
- Multilib check removed (Omarchy ships with multilib enabled)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>