mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-03 17:41:58 +02:00
feat: Feature versions are Steamify versions; Steam Machine support is 2.2.0
This commit is contained in:
1 parent
38642dc6db
commit
2fa347be73
3 files changed
+32
-18
No files matched your search
@@ -29,8 +29,9 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine
|
|||||||
`<id>_available` is checked via `component_available` (e.g. `machine`
|
`<id>_available` is checked via `component_available` (e.g. `machine`
|
||||||
only on Fremont). Turn-on order is `COMPONENTS` order, turn-off reverse;
|
only on Fremont). Turn-on order is `COMPONENTS` order, turn-off reverse;
|
||||||
`gaming` must stay first. Dependencies live in `toggle_component`.
|
`gaming` must stay first. Dependencies live in `toggle_component`.
|
||||||
- **Feature versions.** Bump `FEATURE_VERSION[<id>]` (`lib/menu.sh`) whenever
|
- **Feature versions.** Set `FEATURE_VERSION[<id>]` (`lib/menu.sh`) to the new
|
||||||
what `<id>_enable` sets up changes: installs recorded with an older number
|
`VERSION` whenever what `<id>_enable` sets up changes (a new component gets
|
||||||
|
one too): installs recorded with an older version
|
||||||
are ticked and re-applied ("update" in the plan and the app). New default
|
are ticked and re-applied ("update" in the plan and the app). New default
|
||||||
sub-options are ticked for installs whose parent is on (`feature_new`).
|
sub-options are ticked for installs whose parent is on (`feature_new`).
|
||||||
Status still comes from the system; don't add ad-hoc `<id>_repair` checks
|
Status still comes from the system; don't add ad-hoc `<id>_repair` checks
|
||||||
|
|||||||
+9
-5
@@ -238,20 +238,24 @@ normal run adds it.
|
|||||||
|
|
||||||
## Feature versions (updates)
|
## Feature versions (updates)
|
||||||
|
|
||||||
Each component has a feature version (`FEATURE_VERSION` in `lib/menu.sh`,
|
Each component has a feature version (`FEATURE_VERSION` in `lib/menu.sh`):
|
||||||
1 when not listed). After a component is turned on successfully, the version
|
the Steamify version in which what it sets up last changed (2.1.0 for
|
||||||
is recorded in `~/.local/state/cachyos-gamescope-boot/features.state`
|
everything that hasn't changed since). After a component is turned on
|
||||||
|
successfully, that version is recorded in `~/.local/state/cachyos-gamescope-boot/features.state`
|
||||||
(turning it off records `off`). Whether a component is on is always checked
|
(turning it off records `off`). Whether a component is on is always checked
|
||||||
on the system itself; the version only decides about updates:
|
on the system itself; the version only decides about updates:
|
||||||
|
|
||||||
- **On, recorded version older** than the current one: ticked and
|
- **On, recorded version older** than the current one: ticked and
|
||||||
re-applied by a normal run; the plan (and the app's review) says
|
re-applied by a normal run; the plan (and the app's review) says
|
||||||
"update". A setup from before versions were recorded counts as 1.
|
"update". A setup from before versions were recorded counts as 2.1.0,
|
||||||
|
so on a machine set up with 2.1.0, Steam Machine support (2.2.0) is
|
||||||
|
updated.
|
||||||
- **A new default sub-option** (not in `NO_PRESELECT`) whose parent is on
|
- **A new default sub-option** (not in `NO_PRESELECT`) whose parent is on
|
||||||
and that was never turned on or off: ticked, so a normal run adds it.
|
and that was never turned on or off: ticked, so a normal run adds it.
|
||||||
Turning it off once records `off`, so it isn't ticked again.
|
Turning it off once records `off`, so it isn't ticked again.
|
||||||
|
|
||||||
Bump a component's number whenever what its `<id>_enable` sets up changes.
|
Set a component's entry to the new `VERSION` whenever what its
|
||||||
|
`<id>_enable` sets up changes.
|
||||||
|
|
||||||
## BIOS updates (Steam Machine)
|
## BIOS updates (Steam Machine)
|
||||||
|
|
||||||
|
|||||||
+20
-11
@@ -17,12 +17,18 @@ declare -A PARENT=([boot]=gaming [poweroff]=machine [kpin]=machine [hdmi]=machin
|
|||||||
# which has CEC like on SteamOS. HDMI refresh boost needs someone at the
|
# which has CEC like on SteamOS. HDMI refresh boost needs someone at the
|
||||||
# screen to confirm each step.
|
# screen to confirm each step.
|
||||||
NO_PRESELECT=(boot cec kpin hdmi)
|
NO_PRESELECT=(boot cec kpin hdmi)
|
||||||
# Feature versions: bump a component's number whenever what its enable sets
|
# Feature versions: the Steamify version in which what a component's enable
|
||||||
# up changes. Each successful run records the number (state "features"); a
|
# sets up last changed; set it to the new VERSION whenever you change one.
|
||||||
# component that's on with an older number is ticked and re-applied by a
|
# Each successful run records it (state "features"); a component that's on
|
||||||
# normal run, and the app shows it as an update. Unlisted = 1, and so is a
|
# with an older one is ticked and re-applied by a normal run, and the app
|
||||||
# setup from before these were recorded.
|
# shows it as an update. A setup from before these were recorded counts as
|
||||||
declare -A FEATURE_VERSION=()
|
# FEATURE_BASELINE.
|
||||||
|
FEATURE_BASELINE=2.1.0
|
||||||
|
declare -A FEATURE_VERSION=(
|
||||||
|
[gaming]=2.1.0 [boot]=2.1.0 [theme]=2.1.0 [glyphs]=2.1.0 [single]=2.1.0
|
||||||
|
[launcher]=2.1.0 [cec]=2.1.0 [machine]=2.2.0 [poweroff]=2.2.0
|
||||||
|
[kpin]=2.1.0 [hdmi]=2.1.0
|
||||||
|
)
|
||||||
|
|
||||||
declare -A LABEL=(
|
declare -A LABEL=(
|
||||||
[gaming]="SteamOS conversion: boot into gaming mode, Steam on the desktop"
|
[gaming]="SteamOS conversion: boot into gaming mode, Steam on the desktop"
|
||||||
@@ -66,16 +72,19 @@ menu_visible() {
|
|||||||
|
|
||||||
feature_record() {
|
feature_record() {
|
||||||
# feature_record <component> <enable|disable>: after a successful run.
|
# feature_record <component> <enable|disable>: after a successful run.
|
||||||
if [[ "$2" == enable ]]; then state_set features "$1" "${FEATURE_VERSION[$1]:-1}"
|
if [[ "$2" == enable ]]; then state_set features "$1" "${FEATURE_VERSION[$1]:-$FEATURE_BASELINE}"
|
||||||
else state_set features "$1" off; fi
|
else state_set features "$1" off; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
feature_outdated() {
|
feature_outdated() {
|
||||||
# On, but set up by an older version of that feature.
|
# On, but set up by an older version of that feature (compared as
|
||||||
local have
|
# versions: 2.10.0 is newer than 2.9.0).
|
||||||
|
local have want
|
||||||
[[ "${CURRENT[$1]:-0}" == 1 ]] || return 1
|
[[ "${CURRENT[$1]:-0}" == 1 ]] || return 1
|
||||||
have="$(state_get features "$1" 1)"
|
have="$(state_get features "$1" "$FEATURE_BASELINE")"
|
||||||
[[ "$have" =~ ^[0-9]+$ ]] && (( have < ${FEATURE_VERSION[$1]:-1} ))
|
[[ "$have" == off ]] && have="$FEATURE_BASELINE"
|
||||||
|
want="${FEATURE_VERSION[$1]:-$FEATURE_BASELINE}"
|
||||||
|
[[ "$have" != "$want" && "$(printf '%s\n' "$have" "$want" | sort -V | head -n 1)" == "$have" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
feature_new() {
|
feature_new() {
|
||||||
|
|||||||
Reference in new issue
Block a user