feat: Steamify installer page in progress (CachyOS look, rows from steamify.sh --defaults --list, after the packages page); TODO

This commit is contained in:
theupriser committed 2026-09-28 11:41:00 +02:00
1 parent 78e7c869b9
commit 754a6a14da
10 files changed
+274 -99

No files matched your search

@@ -1,16 +0,0 @@
# Steamify: where the Steam Machine starts (steamify-install passes --boot).
---
mode: required
method: legacy
labels:
step: "Start in"
default: gamescope
items:
- id: gamescope
name: "Gaming mode"
description: "Start straight into Steam's gaming mode, like SteamOS. Switch to Desktop in Steam's power menu brings you to the desktop."
screenshot: ":/images/no-selection.png"
- id: desktop
name: "Desktop"
description: "Start in the Plasma desktop. Return to Gaming Mode on the desktop brings you to Steam's gaming mode."
screenshot: ":/images/no-selection.png"
@@ -1,37 +0,0 @@
# Steamify: which parts of the Steam Machine setup to leave out. Nothing
# selected means Steamify's full default setup; the ids are Steamify's menu
# items (steamify-install passes the others as --options).
---
mode: optionalmultiple
method: legacy
labels:
step: "Steam Machine"
items:
- id: ""
name: "Everything"
description: "Select what to leave out of the Steam Machine setup (Steamify). Leave everything unselected for the full SteamOS-style setup; everything can be changed later in the Steamify app."
screenshot: ":/images/no-selection.png"
- id: theme
name: "Leave out: SteamOS theme"
description: "The Vapor look for the desktop, with SteamOS's panel layout and Add to Steam."
- id: glyphs
name: "Leave out: Steam Deck/Machine icons"
description: "Steam Deck button icons in gaming mode."
- id: single
name: "Leave out: single user mode"
description: "No password, lock screen, user switching or log out, like SteamOS."
- id: launcher
name: "Leave out: Steamify shortcut"
description: "The Steamify app on the desktop and in the launcher, to change these choices later."
- id: notify
name: "Leave out: update notifications"
description: "A notification when there's a new Steamify. It never updates by itself."
- id: vram
name: "Leave out: VRAM booster"
description: "The game in front keeps its video memory; background apps make room."
- id: cec
name: "Leave out: HDMI-CEC"
description: "Use Steam with the TV remote, TV on and off with the Steam Machine."
- id: machine
name: "Leave out: Steam Machine support"
description: "The LED bar driver, hardware settings in Steam and the power-off fix."
@@ -0,0 +1,10 @@
# Steamify: its page (the app's switches, /usr/local/share/steamify-installer/
# SteamifyPage.qml). Legacy method: the page's choice (the ids that are on,
# plus "boot" for Boot into Desktop) goes to global storage as
# packagechooser_steamifypage, for shellprocess_steamify.conf.
---
method: legacy
qmlFilename: /usr/local/share/steamify-installer/SteamifyPage.qml
labels:
step: "Steamify"
packageChoice: gaming,theme,glyphs,single,launcher,notify,vram,cec,machine,poweroff
@@ -4,7 +4,7 @@
dontChroot: true
timeout: 3600
script:
- "-/usr/local/bin/steamify-install ${ROOT} ${USER} \"${gs[packagechooser_steamifyskip]}\" \"${gs[packagechooser_steamifyboot]}\""
- "-/usr/local/bin/steamify-install ${ROOT} ${USER} \"${gs[packagechooser_steamifypage]}\""
i18n:
name: "Setting up the Steam Machine (Steamify)"
@@ -45,10 +45,11 @@ main() {
EOF
sudo cp "/usr/share/calamares/settings_${mode}.conf" /etc/calamares/settings.conf
# Steamify: its step (modules/shellprocess_steamify.conf) before the
# installer cleans up after itself.
sudo sed -i -e 's/^- id: cleanup_calamares$/- id: steamifyskip\n module: packagechooser\n config: packagechooser_steamifyskip.conf\n\n- id: steamifyboot\n module: packagechooser\n config: packagechooser_steamifyboot.conf\n\n- id: steamify\n module: shellprocess\n config: shellprocess_steamify.conf\n\n&/' \
-e 's/^ - packagechooser@desktop$/&\n - packagechooser@steamifyskip\n - packagechooser@steamifyboot/' \
# Steamify: its page (packagechooserq@steamifypage, right after the
# packages page) and its step (modules/shellprocess_steamify.conf) before
# the installer cleans up after itself.
sudo sed -i -e 's/^- id: cleanup_calamares$/- id: steamifypage\n module: packagechooserq\n config: packagechooserq_steamifypage.conf\n\n- id: steamify\n module: shellprocess\n config: shellprocess_steamify.conf\n\n&/' \
-e 's/^ - netinstall$/&\n - packagechooserq@steamifypage/' \
-e 's/^ - shellprocess@cleanup_calamares$/ - shellprocess@steamify\n&/' /etc/calamares/settings.conf
exec pkexec-wrapper calamares -D6 >> $log
}
+18 -17
View File
@@ -1,29 +1,30 @@
#!/bin/bash
# steamify-install <target root> <user> [<skip ids>] [gamescope|desktop]:
# runs Steamify's default setup (minus what the installer's Steam Machine
# page leaves out, where the boot page says) for
# steamify-install <target root> <user> <choice>: runs Steamify's setup for
# the new user inside the installed system (Calamares, after the users and
# services steps). Steamify refuses root and asks sudo per command, so the
# services steps), as chosen on the installer's Steamify page: <choice> is the
# ids that are on, comma-separated, plus "boot" for Boot into Desktop, or
# "none" (packagechooser_steamifypage). Steamify refuses root and asks sudo
# per command, so the
# user gets a NOPASSWD rule for this run only, named to be read last: sudo
# takes the last matching rule, and a later %wheel rule would ask again. Never fails the install: a
# problem leaves the log and Steamify can be run again from the desktop.
root="$1" user="$2"
# The pages' ids, comma-separated; the "Everything" entry is an empty id.
skip="$(tr ',' '\n' <<< "${3:-}" | grep -v '^$' | paste -sd, -)"
boot="${4:-gamescope}"
# Steamify 2.7.0 takes the items to turn on (--options), not the ones to
# leave out: every item of the default setup minus the skipped ones (the
# power-off fix goes with Steam Machine support). Until the Steamify page
# passes the "on" list itself.
options=""
for id in gaming theme glyphs single launcher notify vram cec machine poweroff; do
[[ ",$skip," == *",$id,"* ]] && continue
[[ "$id" == poweroff && ",$skip," == *",machine,"* ]] && continue
options+="${options:+,}$id"
root="$1" user="$2" choice="${3:-}"
# Not filled in by Calamares (empty, or the literal ${gs[...]}): the page's
# default, everything on.
[[ -z "$choice" || "$choice" == *'${'* ]] && choice=gaming,theme,glyphs,single,launcher,notify,vram,cec,machine,poweroff
boot=gamescope options=""
for id in ${choice//,/ }; do
case "$id" in
boot) boot=desktop ;;
none) ;;
*) options+="${options:+,}$id" ;;
esac
done
log="$root/var/log/steamify-install.log"
rule="$root/etc/sudoers.d/zz-steamify-install"
[[ -d "$root" && -n "$user" ]] || exit 0
# Everything switched off on the page: nothing to set up.
[[ -n "$options" ]] || { echo "Nothing chosen on the Steamify page." > "$log"; exit 0; }
install -Dm755 /usr/local/share/steamify/steamify.sh "$root/var/tmp/steamify.sh"
printf '%s ALL=(ALL) NOPASSWD: ALL\n' "$user" > "$rule"
@@ -0,0 +1,20 @@
// The Steamify page's rows when `steamify.sh --defaults --list` can't be run
// (see calamares-online.sh, which writes the real list over this copy in
// /usr/local/share/steamify/qml at the start of the installer).
pragma Singleton
import QtQuick
QtObject {
readonly property var rows: [
{ id: "gaming", label: "SteamOS conversion", hint: "boot into gaming mode, Steam on the desktop", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "boot", label: "Boot into", hint: "", kind: "choice", parent: "gaming", on: false, selectable: true },
{ id: "theme", label: "Install SteamOS theme", hint: "Vapor look (cachyos-vapor)", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "glyphs", label: "Install Steam Deck/Machine icons", hint: "Deck button icons in gaming mode", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "single", label: "Single user mode", hint: "no password, lock screen or log out (SDDM)", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "launcher", label: "Steamify shortcut", hint: "the app on the desktop, Steamify Terminal in the launcher", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "notify", label: "Update notifications", hint: "a notification when there's a new Steamify", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "cec", label: "HDMI-CEC", hint: "use Steam with the TV remote, TV on/off with the PC", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "machine", label: "Steam Machine support", hint: "LED bar driver, hardware settings in Steam", kind: "toggle", parent: "", on: true, selectable: true },
{ id: "poweroff", label: "Power-off fix", hint: "the Steam Machine stays off after shutting down", kind: "toggle", parent: "machine", on: true, selectable: true }
]
}
@@ -0,0 +1,185 @@
// Steamify's page in Calamares (packagechooserq@steamifypage, method legacy),
// styled like the rest of CachyOS's installer: its palette, standard
// controls, CachyOS's turquoise for the selected row. Left the options,
// right what the selected (or hovered) one does.
// The rows come from Steamify itself: calamares-online.sh writes
// ../steamify/qml/Items.qml from `steamify.sh --defaults --list` (the newest
// Steamify, else the ISO's), so new options show up without a new ISO; the
// explanations are the app's (Texts.qml, same folder).
// The choice goes to Calamares' global storage as packagechooser_steamifypage:
// the ids that are on, comma-separated, plus "boot" for Boot into Desktop
// ("none" when nothing is on); steamify-install passes it to
// `steamify.sh --defaults --options ... --boot ...`.
import io.calamares.core 1.0
import io.calamares.ui 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../steamify/qml"
Item {
id: page
width: parent.width
height: parent.height
SystemPalette { id: pal; colorGroup: SystemPalette.Active }
readonly property color accent: "#00CED1"
// Only what can be set up here (Steamify leaves out the rest).
readonly property var rows: Items.rows.filter(function (r) { return r.selectable; })
property var want: ({})
property string boot: "gamescope"
property int sel: 0
function label(r) { return (Texts.items[r.id] || {}).label || r.label; }
function hint(r) { return (Texts.items[r.id] || {}).hint || r.hint; }
function shown(r) { return !r.parent || !!want[r.parent]; }
// Steamify's own rules: a sub-option needs its parent (turning a parent
// off turns its sub-options off); single user mode needs the conversion.
function toggle(id) {
var w = Object.assign({}, want);
w[id] = !w[id];
for (var i = 0; i < rows.length; i++) {
var r = rows[i];
if (w[id] && r.id === id && r.parent) w[r.parent] = true;
if (!w[id] && r.parent === id && r.kind === "toggle") w[r.id] = false;
if (w[id] && r.parent === id && r.kind === "toggle") w[r.id] = true; // opt-out sub-options
}
if (id === "single" && w.single) w.gaming = true;
if (id === "gaming" && !w.gaming) { w.single = false; boot = "gamescope"; }
want = w;
}
function choice() {
var on = [];
for (var i = 0; i < rows.length; i++)
if (rows[i].kind === "toggle" && want[rows[i].id]) on.push(rows[i].id);
if (want.gaming && boot === "desktop") on.push("boot");
return on.length ? on.join(",") : "none";
}
onWantChanged: config.packageChoice = choice()
onBootChanged: config.packageChoice = choice()
Component.onCompleted: {
// Preselected like Steamify's first run.
var w = {};
for (var i = 0; i < rows.length; i++) if (rows[i].kind === "toggle") w[rows[i].id] = rows[i].on;
want = w;
config.packageChoice = choice();
}
ColumnLayout {
anchors.fill: parent
anchors.margins: 16
spacing: 12
Label {
Layout.fillWidth: true
text: "Steamify sets up the SteamOS experience while CachyOS installs. Everything can be changed later with the Steamify app."
wrapMode: Text.WordWrap
color: pal.windowText
}
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 16
ListView {
id: list
Layout.fillHeight: true
Layout.preferredWidth: parent.width * 0.55
clip: true
spacing: 4
boundsBehavior: Flickable.StopAtBounds
model: page.rows
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
delegate: Rectangle {
id: row
required property var modelData
required property int index
readonly property var it: modelData
readonly property bool vis: page.shown(it)
readonly property bool selected: vis && index === page.sel
width: list.width - 12
height: vis ? 52 : 0
visible: vis
radius: 4
color: selected ? Qt.rgba(page.accent.r, page.accent.g, page.accent.b, 0.18) : pal.base
border.width: 1
border.color: selected ? page.accent : Qt.rgba(pal.windowText.r, pal.windowText.g, pal.windowText.b, 0.15)
MouseArea {
anchors.fill: parent; hoverEnabled: true
// Hovering explains a row too, like selecting it.
onEntered: page.sel = row.index
onClicked: { page.sel = row.index; if (row.it.kind === "toggle") page.toggle(row.it.id); }
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: row.it.parent ? 32 : 12
anchors.rightMargin: 12
spacing: 12
ColumnLayout {
Layout.fillWidth: true
spacing: 0
Label { Layout.fillWidth: true; text: page.label(row.it); font.bold: true; elide: Text.ElideRight; color: pal.text }
Label { Layout.fillWidth: true; text: page.hint(row.it); elide: Text.ElideRight; color: pal.text; opacity: 0.7; font.pointSize: 8.5 }
}
Switch {
visible: row.it.kind === "toggle"
checked: !!page.want[row.it.id]
onToggled: { page.sel = row.index; page.toggle(row.it.id); }
}
RowLayout {
visible: row.it.kind === "choice"
spacing: 4
RadioButton { text: "Gaming mode"; checked: page.boot === "gamescope"
onClicked: { page.sel = row.index; page.boot = "gamescope"; } }
RadioButton { text: "Desktop"; checked: page.boot === "desktop"
onClicked: { page.sel = row.index; page.boot = "desktop"; } }
}
}
}
}
// What the selected (or hovered) option does.
Rectangle {
id: detail
readonly property var it: page.rows[page.sel] || ({})
readonly property var tx: Texts.items[it.id] || ({})
Layout.fillWidth: true
Layout.fillHeight: true
radius: 4
color: pal.base
border.width: 1
border.color: Qt.rgba(pal.windowText.r, pal.windowText.g, pal.windowText.b, 0.15)
onItChanged: flick.contentY = 0
Flickable {
id: flick
anchors.fill: parent
anchors.margins: 16
clip: true
contentHeight: col.implicitHeight
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
ColumnLayout {
id: col
width: flick.width - 12
spacing: 10
Label { Layout.fillWidth: true; text: detail.it.id ? page.label(detail.it) : ""; font.bold: true; font.pointSize: 13
wrapMode: Text.WordWrap; color: pal.text }
Label { Layout.fillWidth: true; text: detail.tx.body || page.hint(detail.it) || ""; wrapMode: Text.WordWrap; color: pal.text }
Label { visible: (detail.tx.changes || []).length > 0; text: "What it changes"; font.bold: true; color: pal.text; topPadding: 4 }
Repeater {
model: detail.tx.changes || []
Label { required property string modelData; Layout.fillWidth: true; text: "• " + modelData
wrapMode: Text.WordWrap; color: pal.text }
}
}
}
}
}
}
}