v0.1.9 — auto-migrate legacy CUSTOM_REFRESH_RATES on installer re-run
Pre-v0.1.8 users have a scalar CUSTOM_REFRESH_RATES=<rate> 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,<rate>) 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) <noreply@anthropic.com>
This commit is contained in:
parent
4fa77a6238
commit
3131dcab8f
2 changed files with 24 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# DeckShift
|
# 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.
|
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
|
## 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
|
### 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.
|
- 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.
|
||||||
|
|
|
||||||
20
deckshift.sh
20
deckshift.sh
|
|
@ -34,7 +34,7 @@ set -Euo pipefail
|
||||||
# -u: Treat unset variables as errors (catches typos in variable names)
|
# -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
|
# -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
|
# Resolve the directory this script lives in so we can find sibling files like
|
||||||
# bin/deckshift-settings and applications/deckshift-settings.desktop when
|
# bin/deckshift-settings and applications/deckshift-settings.desktop when
|
||||||
|
|
@ -1866,6 +1866,24 @@ UDISKS_POLKIT
|
||||||
mkdir -p "$env_dir"
|
mkdir -p "$env_dir"
|
||||||
touch "$gamescope_conf"
|
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.
|
# Per-key updater — replaces in place if present, appends if missing.
|
||||||
# Same shape as the TUI's flush_pending so the two never fight.
|
# Same shape as the TUI's flush_pending so the two never fight.
|
||||||
set_conf_key() {
|
set_conf_key() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue