Add bar spots beside the notch, and Caffeine and Night Light modules

Notch mode gets two more module lists, notch.innerLeft and
notch.innerRight: spots right beside the notch at the same distance on
both sides. They follow the notch's edges as it springs wider for media,
never draw pills (plugins and the tray drop theirs there), and fade out
while the notch is open or widened. Picking a module for one of the four
side spots in Settings -> Notch moves it there from the others.

Caffeine and Night Light are now bar modules too; Night Light polls its
state every 30 s while only the bar watches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-29 23:27:01 +01:00
1 parent 3f0e31b116
commit bc197339fa
12 files changed
+169 -13

No files matched your search

+1 -1
View File
@@ -86,7 +86,7 @@ function validate(c) {
const dashTabs=new Set();
for(const t of dash.tabs) { if(!t || typeof t.id!=="string" || dashTabs.has(t.id) || typeof t.enabled!=="boolean")throw Error("Invalid dashboard tab"); dashTabs.add(t.id); }
if(!c.notch || ["enabled","mediaFirst"].some(k=>typeof c.notch[k]!=="boolean"))throw Error("Invalid notch preferences");
for(const key of ["left","right","strip"]) if(!Array.isArray(c.notch[key]) || c.notch[key].some(id=>typeof id!=="string" || !id))throw Error("Invalid notch modules");
for(const key of ["left","right","innerLeft","innerRight","strip"]) if(!Array.isArray(c.notch[key]) || c.notch[key].some(id=>typeof id!=="string" || !id))throw Error("Invalid notch modules");
if(!Array.isArray(c.notch.controls) || c.notch.controls.some(m=>!m || typeof m.id!=="string" || typeof m.enabled!=="boolean" || ["w","h"].some(k=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<1 || m[k]>4)) || [["x",3],["y",63]].some(([k,max])=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<0 || m[k]>max))))throw Error("Invalid notch controls");
if(!Number.isFinite(c.notch.opacity) || c.notch.opacity<0 || c.notch.opacity>100 || typeof c.notch.color!=="string" || (c.notch.color!=="" && !/^#[0-9a-fA-F]{6}$/.test(c.notch.color)))throw Error("Invalid notch colour");
if(typeof c.notch.glassOnOpen!=="boolean" || typeof c.notch.launcherMatch!=="boolean" || ["openSpeed","closeSpeed","colorSpeed","panelOpenSpeed","panelCloseSpeed"].some(k=>!Number.isFinite(c.notch[k]) || c.notch[k]<25 || c.notch[k]>300))throw Error("Invalid notch animation");
+8 -1
View File
@@ -13,7 +13,14 @@ Singleton {
// them for every background status poll flickered them every five seconds.
readonly property bool acting: (job.running && job.request.op === "action") || queued !== null
property var queued: null
// Bar modules showing Night Light; while only they watch, it polls slowly.
property int nightLightWatchers: 0
readonly property var features: {
const own = panelFeatures;
return nightLightWatchers > 0 && !own.includes("nightLight") ? own.concat(["nightLight"]) : own;
}
readonly property bool panelObserved: panelFeatures.length > 0
readonly property var panelFeatures: {
if (!ConfigService.ready)
return [];
if (ShellState.controlCenterOpen || ShellState.notchOpen)
@@ -79,7 +86,7 @@ Singleton {
}
}
Timer {
interval: 5000
interval: root.panelObserved ? 5000 : 30000
repeat: true
running: root.observed
onTriggered: root.refresh()