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() {