aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-12 10:10:14 +0200
committerDanilo M. <danix@danix.xyz>2026-09-12 10:10:14 +0200
commit10d955193b6778cfb26cc601b05aa65bff1810df (patch)
tree49b8383fde99b8636fe2a8bfede5e25c3c520c62
parent15367430ddafd45c59310364234fa3ceefee3844 (diff)
downloadquickshell-10d955193b6778cfb26cc601b05aa65bff1810df.tar.gz
quickshell-10d955193b6778cfb26cc601b05aa65bff1810df.zip
feat(mail-overview): component skeleton with the keepalive window
Nothing is drawn yet. This commit exists on its own because the thing most likely to be wrong at this stage is invisible: a config whose only window is hidden exits straight after logging Configuration Loaded, reporting no error, and the symptom is a keybind that appears to do nothing. Theme.qml is a verbatim copy of the one in appearance. It is a fallback for before the generated palette is read, not a palette to grow; deduplicating the four copies is a separate change. Not yet run: the user runs the shell themselves, so loading and IPC are verified in their session rather than here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWL8JYHu7yhAdtx5pU9PMU
-rw-r--r--mail-overview/MailPanel.qml41
-rw-r--r--mail-overview/Theme.qml66
-rw-r--r--mail-overview/shell.qml24
3 files changed, 131 insertions, 0 deletions
diff --git a/mail-overview/MailPanel.qml b/mail-overview/MailPanel.qml
new file mode 100644
index 0000000..7e81a33
--- /dev/null
+++ b/mail-overview/MailPanel.qml
@@ -0,0 +1,41 @@
+// 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.
+
+import Quickshell
+import Quickshell.Wayland
+import QtQuick
+
+Scope {
+ id: root
+
+ // Waybar runs on this screen, so the drawer belongs here too.
+ property string monitor: "DP-1"
+ property bool open: false
+
+ readonly property var screenObj:
+ Quickshell.screens.find(s => s.name === root.monitor) ?? Quickshell.screens[0]
+
+ function show() { root.open = true; }
+ function close() { root.open = false; }
+ function toggle() { root.open ? close() : show(); }
+
+ // Quickshell exits once no window is visible, and this drawer is closed
+ // most of the time. See AGENTS.md.
+ PanelWindow {
+ visible: true
+ implicitWidth: 1
+ implicitHeight: 1
+ color: "transparent"
+ exclusionMode: ExclusionMode.Ignore
+ mask: Region {}
+ WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
+ }
+}
diff --git a/mail-overview/Theme.qml b/mail-overview/Theme.qml
new file mode 100644
index 0000000..423dd49
--- /dev/null
+++ b/mail-overview/Theme.qml
@@ -0,0 +1,66 @@
+// 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 palette comes from unified-desktop-theme: udt-accent writes
+// ~/.cache/wal/udt-palette.qml on every wallpaper change, holding the
+// Macchiato colours from its palette.rasi plus the accent snapped from the
+// wallpaper. Watching that file is what makes a theme edit show up here.
+//
+// The defaults below are only what renders before the file is read, or on a
+// machine where unified-desktop-theme is not installed.
+Singleton {
+ id: root
+
+ property color base: "#24273a"
+ property color surface: "#363a4f"
+ property color text: "#cad3f5"
+ property color subtext: "#a5adcb"
+ property color red: "#ed8796"
+ property color green: "#a6da95"
+ property color yellow: "#eed49f"
+ property color surfaceAlt: "#494d64"
+ property color overlay: "#6e738d"
+ property color accent: "#b7bdf8"
+
+ readonly property string fontFamily: "Noto Sans"
+ readonly property int fontSize: 16
+
+ // Parsed rather than imported: a generated file cannot be a QML import
+ // without a qmldir next to it, and the cache directory has no reason to
+ // carry one. The format is fixed and machine-written, so a regex is enough.
+ FileView {
+ path: `${Quickshell.env("HOME")}/.cache/wal/udt-palette.qml`
+ watchChanges: true
+ onFileChanged: reload()
+ onLoaded: {
+ const pick = key => {
+ const m = text().match(new RegExp(`property color ${key}: "(#[0-9a-fA-F]{6})"`));
+ return m ? m[1] : null;
+ };
+ root.base = pick("base") ?? root.base;
+ root.surface = pick("surface0") ?? root.surface;
+ root.text = pick("text") ?? root.text;
+ root.subtext = pick("subtext0") ?? root.subtext;
+ root.red = pick("red") ?? root.red;
+ root.green = pick("green") ?? root.green;
+ root.yellow = pick("yellow") ?? root.yellow;
+ root.surfaceAlt = pick("surface1") ?? root.surfaceAlt;
+ root.overlay = pick("overlay0") ?? root.overlay;
+ root.accent = pick("accent") ?? root.accent;
+ }
+ }
+}
diff --git a/mail-overview/shell.qml b/mail-overview/shell.qml
new file mode 100644
index 0000000..cd2e907
--- /dev/null
+++ b/mail-overview/shell.qml
@@ -0,0 +1,24 @@
+// 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.
+
+import Quickshell
+import Quickshell.Io
+
+ShellRoot {
+ MailPanel { id: panel }
+
+ IpcHandler {
+ target: "mail"
+ function toggle() { panel.toggle(); }
+ function show() { panel.show(); }
+ function close() { panel.close(); }
+ }
+}