aboutsummaryrefslogtreecommitdiffstats
path: root/appearance/Steps.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-17 10:16:40 +0200
committerDanilo M. <danix@danix.xyz>2026-10-17 10:16:40 +0200
commit70bbc970c75221c902c515efd124c47fd702e3b7 (patch)
treed35f6b1ffbb506b65430af7fc1eca2c432879a22 /appearance/Steps.qml
parente5399f3e8d8572f1db7c4391a7c571d4845500f1 (diff)
downloadquickshell-70bbc970c75221c902c515efd124c47fd702e3b7.tar.gz
quickshell-70bbc970c75221c902c515efd124c47fd702e3b7.zip
appearance moves into the settings window
The appearance shell existed because a wallpaper picker needed more room than the 600px drawer, so it ran as its own process with a full-screen overlay. The settings window now gives it that room, and its five tabs become five settings pages in the desktop process: Wallpaper, Theme, Icons & cursor, Sunset and Idle. appearance/ is gone, and with it a process, a keepalive window and a layer blur rule. The files move to desktop/modules/appearance/ unchanged in what they do. Each tab gets a small *Module.qml; the window's refresh-on-open calls the singletons' refresh(), which the panel's show() used to. The two tabs that were inline Components in AppearancePanel become ThemeTab and WallpaperTab, owning the notices the panel printed. Sunset, Idle and Icons drop their own Flickable so the page scrolls them and search can reveal a row; the wallpaper list virtualises its rows and scrolls itself, so it takes the page's new viewHeight instead. Search finds a colour scheme and an icon or cursor theme by name. The appearance IPC target moves to desktop/shell.qml with the same verbs, so udt-steps and any keybind change only the path. Git now follows the appearance pages and autostart in the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'appearance/Steps.qml')
-rw-r--r--appearance/Steps.qml114
1 files changed, 0 insertions, 114 deletions
diff --git a/appearance/Steps.qml b/appearance/Steps.qml
deleted file mode 100644
index ec0a5b7..0000000
--- a/appearance/Steps.qml
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-pragma Singleton
-
-import Quickshell
-import Quickshell.Io
-import QtQuick
-
-// The manual steps unified-desktop-theme cannot run itself: root copies into
-// /boot and /usr/share/sddm, the finish on the homepage host, and the last
-// install.sh log. Each is a file in ~/.cache/udt/steps/, written by
-// udt-steps, which then calls this shell's `steps` IPC verb. Nothing is
-// watched: the poke is the signal, and a shell started later finds the files
-// on its first reload.
-Singleton {
- id: root
-
- readonly property string dir: `${Quickshell.env("HOME")}/.cache/udt/steps`
-
- // [{ name, label, blocks: [{ cmd, text }] }]: the install.sh recap first,
- // then one tab per consumer by name. A file with no label here shows
- // under its own name, so a new producer needs no edit.
- property var tabs: []
- readonly property var labels: ({
- install: "General recap", grub: "GRUB", sddm: "SDDM", homepage: "Homepage",
- })
- signal loaded
-
- // A line indented two spaces is a command, and a run of them is one block
- // with its own copy button. Blank lines split prose into paragraphs. The
- // format is what the producers already print to a terminal.
- function parse(text) {
- const out = [];
- const lines = text.split("\n");
- for (let i = 0; i < lines.length; i++) {
- const line = lines[i];
- const cmd = line.startsWith(" ");
- const last = out.length ? out[out.length - 1] : null;
- if (!cmd && line.trim() === "") {
- if (last) last.closed = true;
- continue;
- }
- const body = cmd ? line.slice(2) : line;
- if (last && last.cmd === cmd && !last.closed) last.lines.push(body);
- else out.push({ cmd: cmd, lines: [body], closed: false });
- }
- return out.map(b => ({ cmd: b.cmd, text: b.lines.join("\n") }));
- }
-
- function commands(tab) {
- return tab.blocks.filter(b => b.cmd).map(b => b.text).join("\n");
- }
-
- function copy(text) {
- Quickshell.execDetached(["wl-copy", "--", text]);
- }
-
- function refresh() {
- listProc.running = false;
- listProc.running = true;
- }
-
- function dismiss(name) {
- rmProc.command = ["rm", "-f", `${root.dir}/${name}`];
- rmProc.running = true;
- }
-
- // One pass over every file, each prefixed by an ASCII record separator
- // and its name. The names are udt-steps' [a-z0-9-], and its temporary
- // files are dotfiles, which the glob skips.
- Process {
- id: listProc
- command: ["sh", "-c",
- `cd ${JSON.stringify(root.dir)} 2>/dev/null || exit 0; ` +
- `for f in *; do [ -f "$f" ] && printf '\\036%s\\n' "$f" && cat "$f"; done`]
- stdout: StdioCollector {
- onStreamFinished: {
- root.tabs = text.split("\x1e").filter(s => s.length).map(rec => {
- const nl = rec.indexOf("\n");
- const name = rec.slice(0, nl);
- return { name: name, label: root.labels[name] ?? name,
- blocks: root.parse(rec.slice(nl + 1)) };
- }).sort((a, b) => (b.name === "install") - (a.name === "install")
- || a.label.localeCompare(b.label));
- root.loaded();
- }
- }
- }
-
- Process {
- id: rmProc
- onExited: root.refresh()
- }
-
- function selftest(): string {
- const b = root.parse("Intro line\nstill intro\n cmd one\n cmd two\n\nNext para\n cmd three\n");
- if (b.length !== 4 || b[0].cmd || b[0].text !== "Intro line\nstill intro" ||
- !b[1].cmd || b[1].text !== "cmd one\ncmd two" || b[2].text !== "Next para" ||
- b[3].text !== "cmd three")
- return `SELFTEST Steps FAIL: ${JSON.stringify(b)}`;
- if (root.commands({ blocks: b }) !== "cmd one\ncmd two\ncmd three")
- return "SELFTEST Steps FAIL: commands";
- return "SELFTEST Steps PASS";
- }
-}