From 3131dcab8f9fc7ab4b264325f7141ab353e88513 Mon Sep 17 00:00:00 2001 From: 28allday Date: Sun, 17 May 2026 20:15:24 +0100 Subject: [PATCH] =?UTF-8?q?v0.1.9=20=E2=80=94=20auto-migrate=20legacy=20CU?= =?UTF-8?q?STOM=5FREFRESH=5FRATES=20on=20installer=20re-run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-v0.1.8 users have a scalar CUSTOM_REFRESH_RATES= in their gamescope-session-plus.conf that triggers the 60 Hz launch bug. v0.1.8 only fixed the TUI write path, so existing users had to re-open the TUI and re-pick the rate to migrate. Installer now detects the legacy scalar format and rewrites to the comma list (60,) on re-run, then imports the new value into the running systemd user environment. Idempotent — already-migrated configs are left alone. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 6 +++++- deckshift.sh | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31747d9..71e45f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DeckShift -**Version 0.1.8** — Steam Deck-style gaming mode for [Omarchy](https://omarchy.com). Press `Super+Shift+S` to enter Gaming Mode (Steam Big Picture in Gamescope), `Super+Shift+R` to return to your desktop. +**Version 0.1.9** — Steam Deck-style gaming mode for [Omarchy](https://omarchy.com). Press `Super+Shift+S` to enter Gaming Mode (Steam Big Picture in Gamescope), `Super+Shift+R` to return to your desktop. Lineage: forked from [Super-Shift-S-Omarchy-Deck-Mode](https://git.no-signal.uk/nosignal/Super-Shift-S-Omarchy-Deck-Mode), briefly renamed Omarchy Deck, then renamed DeckShift. @@ -10,6 +10,10 @@ Lineage: forked from [Super-Shift-S-Omarchy-Deck-Mode](https://git.no-signal.uk/ ## What's New +### v0.1.9 — Auto-migrate legacy refresh-rate values + +- Installer now detects pre-v0.1.8 scalar `CUSTOM_REFRESH_RATES` values (e.g. `165`) and rewrites them to the v0.1.8 comma format (`60,165`), then imports the new value into the running systemd user environment. Re-running `./deckshift.sh` is enough to fix Gaming Mode for users hit by the 60 Hz bug — no need to re-open the Settings TUI and re-pick the rate. + ### v0.1.8 — Settings TUI now reaches gamescope without re-login - The Settings TUI used to write `~/.config/environment.d/gamescope-session-plus.conf` and rely on the user logging out before the change reached `gamescope-session-plus@.service`. Saving the TUI now calls `systemctl --user import-environment` for the keys it just wrote, so the next Gaming Mode launch picks up the new values immediately. diff --git a/deckshift.sh b/deckshift.sh index e479956..dbda7d1 100755 --- a/deckshift.sh +++ b/deckshift.sh @@ -34,7 +34,7 @@ set -Euo pipefail # -u: Treat unset variables as errors (catches typos in variable names) # -o pipefail: A pipeline fails if ANY command in it fails, not just the last one -DECKSHIFT_VERSION="0.1.8" +DECKSHIFT_VERSION="0.1.9" # Resolve the directory this script lives in so we can find sibling files like # bin/deckshift-settings and applications/deckshift-settings.desktop when @@ -1866,6 +1866,24 @@ UDISKS_POLKIT mkdir -p "$env_dir" touch "$gamescope_conf" + # Legacy CUSTOM_REFRESH_RATES migration (added in v0.1.9). + # + # Pre-v0.1.8 the Settings TUI wrote CUSTOM_REFRESH_RATES as a single rate + # (e.g. "165"). Gamescope's --custom-refresh-rates is a list of *switchable* + # rates, not a launch-rate selector — and with no safe 60 Hz fallback in the + # list, some DRM/NVIDIA paths drop to the EDID-preferred 60 Hz on first + # launch. v0.1.8+ writes a comma list (e.g. "60,165") from the TUI, but + # existing users still have the scalar in their conf. Rewrite it here so + # re-running the installer is enough to fix Gaming Mode for them — no need + # to re-open the TUI and re-pick the rate. + local legacy_rate + legacy_rate=$(grep -E '^CUSTOM_REFRESH_RATES=[0-9]+$' "$gamescope_conf" | head -1 | cut -d= -f2) + if [[ -n "$legacy_rate" && "$legacy_rate" != "60" ]]; then + info "Migrating CUSTOM_REFRESH_RATES=${legacy_rate} → 60,${legacy_rate} (v0.1.9 format)" + sed -i "s|^CUSTOM_REFRESH_RATES=.*|CUSTOM_REFRESH_RATES=60,${legacy_rate}|" "$gamescope_conf" + systemctl --user import-environment CUSTOM_REFRESH_RATES 2>/dev/null || true + fi + # Per-key updater — replaces in place if present, appends if missing. # Same shape as the TUI's flush_pending so the two never fight. set_conf_key() {