Drop the daytime widget, use clock everywhere

Clock and daytime were near-duplicates with different click semantics
(clock toggles between formats on left-click and opens the timezone
selector on right-click; daytime was non-pressable with a hover tooltip).
Standardize on clock, since it's the more capable of the two.

- Delete widgets/daytime.qml and its FirstPartyWidgets entry.
- Migrate shell-defaults.json, shell.qml's builtin fallback, Bar.qml's
  fallback bar config, and the settings panel's builtin defaults so the
  center anchor and center-section entry both reference "clock".
- Rename the daytimeSettings form to clockSettings and rephrase
  "Tooltip format" → "Alternate format (click to toggle)" so the field
  label matches clock's actual behavior.
- Update the gallery dropdown options and bar/README docs.
This commit is contained in:
David Heinemeier Hansson
2026-05-20 21:23:30 +02:00
parent 9732279832
commit 6090d46dfd
9 changed files with 31 additions and 77 deletions
+4 -4
View File
@@ -168,10 +168,10 @@ rewrites the `bar` subtree from the current `shell-defaults.json`.
"bar": { "bar": {
"position": "top", "position": "top",
"transparent": false, "transparent": false,
"centerAnchor": "daytime", "centerAnchor": "clock",
"layout": { "layout": {
"left": [ { "id": "omarchy" }, { "id": "workspaces" } ], "left": [ { "id": "omarchy" }, { "id": "workspaces" } ],
"center": [ { "id": "daytime", "format": "HH:mm" } ], "center": [ { "id": "clock", "format": "HH:mm" } ],
"right": [ "right": [
{ "id": "audioPanel" } { "id": "audioPanel" }
] ]
@@ -194,8 +194,8 @@ rewrites the `bar` subtree from the current `shell-defaults.json`.
settings UI adds/removes layout entries; other plugin kinds are enabled settings UI adds/removes layout entries; other plugin kinds are enabled
with the shell IPC. First-party plugins are always enabled. with the shell IPC. First-party plugins are always enabled.
4. **Multiple instances** are allowed when a manifest sets 4. **Multiple instances** are allowed when a manifest sets
`allowMultiple: true`. Each instance is independent — e.g. two daytime `allowMultiple: true`. Each instance is independent — e.g. two clock
widgets in different timezones are just two `{"id":"daytime", "timezone": ...}` widgets in different timezones are just two `{"id":"clock", "timezone": ...}`
entries with their own values. entries with their own values.
5. **Idle timings are top-level.** `idle.screensaver` and `idle.lock` 5. **Idle timings are top-level.** `idle.screensaver` and `idle.lock`
are seconds since user idle began, so the default lock fires at 300s are seconds since user idle began, so the default lock fires at 300s
+1 -1
View File
@@ -31,7 +31,7 @@ Item {
property var fallbackBarConfig: ({ property var fallbackBarConfig: ({
position: "top", position: "top",
transparent: false, transparent: false,
centerAnchor: "daytime", centerAnchor: "clock",
layout: { left: [], center: [], right: [] } layout: { left: [], center: [], right: [] }
}) })
property var layoutConfig: fallbackBarConfig.layout property var layoutConfig: fallbackBarConfig.layout
+1 -2
View File
@@ -14,8 +14,7 @@ QtObject {
"networkPanel": { displayName: "Network", description: "Wi-Fi list and connection state", category: "Network", allowMultiple: false, sourceDir: "../panels", sourceName: "Network" }, "networkPanel": { displayName: "Network", description: "Wi-Fi list and connection state", category: "Network", allowMultiple: false, sourceDir: "../panels", sourceName: "Network" },
"powerPanel": { displayName: "Power", description: "Battery, power profile, and system stats", category: "System", allowMultiple: false, sourceDir: "../panels", sourceName: "Power" }, "powerPanel": { displayName: "Power", description: "Battery, power profile, and system stats", category: "System", allowMultiple: false, sourceDir: "../panels", sourceName: "Power" },
"bluetoothPanel": { displayName: "Bluetooth", description: "Bluetooth device list with connect/disconnect", category: "Network", allowMultiple: false, sourceDir: "../panels", sourceName: "Bluetooth" }, "bluetoothPanel": { displayName: "Bluetooth", description: "Bluetooth device list with connect/disconnect", category: "Network", allowMultiple: false, sourceDir: "../panels", sourceName: "Bluetooth" },
"clock": { displayName: "Clock", description: "Date / time text", category: "Time", allowMultiple: false }, "clock": { displayName: "Clock", description: "Day/time label; click to toggle alternate format", category: "Time", allowMultiple: false, settingsForm: "clockSettings" },
"daytime": { displayName: "Daytime", description: "Day/time label with date tooltip", category: "Time", allowMultiple: false, settingsForm: "daytimeSettings" },
"indicators": { displayName: "Indicators", description: "Manual state indicators", category: "Status", allowMultiple: false }, "indicators": { displayName: "Indicators", description: "Manual state indicators", category: "Status", allowMultiple: false },
"notificationCenter": { displayName: "Notification center", description: "Recent notifications + DND", category: "Status", allowMultiple: false }, "notificationCenter": { displayName: "Notification center", description: "Recent notifications + DND", category: "Status", allowMultiple: false },
"systemUpdate": { displayName: "System update", description: "Indicates available system updates", category: "System", allowMultiple: false }, "systemUpdate": { displayName: "System update", description: "Indicates available system updates", category: "System", allowMultiple: false },
+3 -4
View File
@@ -16,7 +16,7 @@ the shell for its whole session.
The bar config lives under the `bar:` key of [`~/.config/omarchy/shell.json`](../../README.md#shelljson-shape). Out of the box the shell uses [`shell-defaults.json`](../../shell-defaults.json). Once you customize anything via `omarchy launch bar settings` or by editing shell.json directly, your file is canonical — there is no deep-merge. The bar config lives under the `bar:` key of [`~/.config/omarchy/shell.json`](../../README.md#shelljson-shape). Out of the box the shell uses [`shell-defaults.json`](../../shell-defaults.json). Once you customize anything via `omarchy launch bar settings` or by editing shell.json directly, your file is canonical — there is no deep-merge.
Launch the visual editor with `omarchy launch bar settings` (or run `omarchy-launch-bar-settings`) to reorder widgets, add/remove them, and tweak per-widget options without editing JSON by hand. You can also right-click empty space to the left or right of the centered daytime module to open it; double-left-click the same empty space to toggle bar transparency. Launch the visual editor with `omarchy launch bar settings` (or run `omarchy-launch-bar-settings`) to reorder widgets, add/remove them, and tweak per-widget options without editing JSON by hand. You can also right-click empty space to the left or right of the centered clock module to open it; double-left-click the same empty space to toggle bar transparency.
Example `shell.json` (bar subtree only shown): Example `shell.json` (bar subtree only shown):
@@ -26,7 +26,7 @@ Example `shell.json` (bar subtree only shown):
"bar": { "bar": {
"position": "top", "position": "top",
"transparent": false, "transparent": false,
"centerAnchor": "daytime", "centerAnchor": "clock",
"layout": { "layout": {
"left": [ "left": [
{ "id": "omarchy" }, { "id": "omarchy" },
@@ -35,7 +35,7 @@ Example `shell.json` (bar subtree only shown):
], ],
"center": [ "center": [
{ "id": "media" }, { "id": "media" },
{ "id": "daytime", "format": "HH:mm" } { "id": "clock", "format": "HH:mm" }
], ],
"right": [ "right": [
{ "id": "audioPanel" }, { "id": "audioPanel" },
@@ -58,7 +58,6 @@ Example `shell.json` (bar subtree only shown):
| `workspaces` | Hyprland workspace switcher | left = focus workspace | | `workspaces` | Hyprland workspace switcher | left = focus workspace |
| `clock` | Date/time label | left = alternate format · right = timezone selector | | `clock` | Date/time label | left = alternate format · right = timezone selector |
| `media` | MPRIS now-playing — scrolling track + artist, cover-art popup | left = play/pause · middle = next · scroll = prev/next · right = popup | | `media` | MPRIS now-playing — scrolling track + artist, cover-art popup | left = play/pause · middle = next · scroll = prev/next · right = popup |
| `daytime` | Day/time label with date tooltip | hover = date |
| `indicators` | Manual state indicators | left = indicator action | | `indicators` | Manual state indicators | left = indicator action |
| `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND | | `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND |
| `systemUpdate` | Available update indicator | left = update | | `systemUpdate` | Available update indicator | left = update |
-43
View File
@@ -1,43 +0,0 @@
import QtQuick
import Quickshell
import qs.Commons
import qs.Ui
BarWidget {
id: root
moduleName: "daytime"
property date now: new Date()
function formatLabel() {
if (!bar) return ""
var fmt = bar.vertical
? String(setting("verticalFormat", "HH\n—\nmm"))
: String(setting("format", "dddd HH:mm"))
return Qt.formatDateTime(now, fmt)
}
function tooltipLabel() {
return Qt.formatDateTime(root.now, String(setting("formatAlt", "dd MMMM yyyy")))
}
implicitWidth: button.implicitWidth
implicitHeight: button.implicitHeight
SystemClock {
id: clockTimer
precision: SystemClock.Minutes
onDateChanged: root.now = clockTimer.date
}
WidgetButton {
id: button
anchors.fill: parent
bar: root.bar
text: root.formatLabel()
horizontalMargin: 8.75
verticalPadding: 8.75
tooltipText: root.tooltipLabel()
pressable: false
}
}
+2 -3
View File
@@ -105,7 +105,7 @@ Item {
property string choiceDemoValue: "top" property string choiceDemoValue: "top"
property bool toggleDemoOn: true property bool toggleDemoOn: true
property bool toggleSquareOn: false property bool toggleSquareOn: false
property string dropdownDemoValue: "daytime" property string dropdownDemoValue: "clock"
property string searchableDemoValue: "" property string searchableDemoValue: ""
property int numberDemoValue: 15 property int numberDemoValue: 15
@@ -1523,7 +1523,7 @@ Item {
width: Style.spacing.dropdownWidth width: Style.spacing.dropdownWidth
label: "Center anchor" label: "Center anchor"
fontFamily: root.fontFamily fontFamily: root.fontFamily
options: ["daytime", "weather", "clock", "powerPanel"] options: ["clock", "weather", "powerPanel"]
value: root.dropdownDemoValue value: root.dropdownDemoValue
hasCursor: root.focusSection === "dropdown" && root.selectedIndex === 0 hasCursor: root.focusSection === "dropdown" && root.selectedIndex === 0
onHovered: function(h) { onHovered: function(h) {
@@ -1593,7 +1593,6 @@ Item {
{ value: "network", label: "Network", description: "Wi-Fi + ethernet status" }, { value: "network", label: "Network", description: "Wi-Fi + ethernet status" },
{ value: "bluetooth", label: "Bluetooth", description: "Paired and nearby devices" }, { value: "bluetooth", label: "Bluetooth", description: "Paired and nearby devices" },
{ value: "monitor", label: "Monitor", description: "Brightness + scale" }, { value: "monitor", label: "Monitor", description: "Brightness + scale" },
{ value: "daytime", label: "Daytime", description: "Day/time label" },
{ value: "media", label: "Media", description: "Now-playing + transport" }, { value: "media", label: "Media", description: "Now-playing + transport" },
{ value: "workspaces", label: "Workspaces", description: "Hyprland workspace pills" }, { value: "workspaces", label: "Workspaces", description: "Hyprland workspace pills" },
{ value: "system-tray", label: "System tray", description: "StatusNotifierItem icons" }, { value: "system-tray", label: "System tray", description: "StatusNotifierItem icons" },
+15 -15
View File
@@ -128,11 +128,11 @@ Item {
bar: { bar: {
position: "top", position: "top",
transparent: false, transparent: false,
centerAnchor: "daytime", centerAnchor: "clock",
layout: { layout: {
left: [{ id: "omarchy" }, { id: "workspaces" }], left: [{ id: "omarchy" }, { id: "workspaces" }],
center: [ center: [
{ id: "daytime", format: "dddd HH:mm", formatAlt: "dd MMMM yyyy", verticalFormat: "HH\n\u2014\nmm" }, { id: "clock", format: "dddd HH:mm", formatAlt: "dd MMMM yyyy", verticalFormat: "HH\n\u2014\nmm" },
{ id: "weather" }, { id: "indicators", items: [ "dnd", "nightlight", "stayAwake", "screenrecording", "dictation" ] }, { id: "systemUpdate" } { id: "weather" }, { id: "indicators", items: [ "dnd", "nightlight", "stayAwake", "screenrecording", "dictation" ] }, { id: "systemUpdate" }
], ],
right: [ right: [
@@ -145,7 +145,7 @@ Item {
}) })
property var defaultConfig: builtinShellConfig property var defaultConfig: builtinShellConfig
property var draft: ({ version: 1, bar: { position: "top", transparent: false, centerAnchor: "daytime", layout: { left: [], center: [], right: [] } }, plugins: [] }) property var draft: ({ version: 1, bar: { position: "top", transparent: false, centerAnchor: "clock", layout: { left: [], center: [], right: [] } }, plugins: [] })
property int draftRevision: 0 property int draftRevision: 0
property bool suppressReload: false property bool suppressReload: false
@@ -1124,7 +1124,7 @@ Item {
if (meta && meta.settingsForm) { if (meta && meta.settingsForm) {
switch (meta.settingsForm) { switch (meta.settingsForm) {
case "spacerSettings": return spacerSettingsComponent case "spacerSettings": return spacerSettingsComponent
case "daytimeSettings": return daytimeSettingsComponent case "clockSettings": return clockSettingsComponent
case "weatherSettings": return weatherSettingsComponent case "weatherSettings": return weatherSettingsComponent
} }
} }
@@ -1166,24 +1166,24 @@ Item {
} }
Component { Component {
id: daytimeSettingsComponent id: clockSettingsComponent
Column { Column {
id: calForm id: clockForm
signal fieldChanged(string key, var value) signal fieldChanged(string key, var value)
property var entry: ({}) property var entry: ({})
spacing: Style.spacing.rowGap spacing: Style.spacing.rowGap
width: parent ? parent.width : 0 width: parent ? parent.width : 0
component DaytimeField: TextField { component ClockField: TextField {
property string fieldKey: "" property string fieldKey: ""
width: parent.width width: parent.width
foreground: root.foreground foreground: root.foreground
accent: root.accent accent: root.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
onEditingFinished: if (fieldKey) calForm.fieldChanged(fieldKey, text) onEditingFinished: if (fieldKey) clockForm.fieldChanged(fieldKey, text)
} }
Text { Text {
@@ -1192,20 +1192,20 @@ Item {
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.bodySmall font.pixelSize: Style.font.bodySmall
} }
DaytimeField { ClockField {
fieldKey: "format" fieldKey: "format"
text: calForm.entry.format || "dddd HH:mm" text: clockForm.entry.format || "dddd HH:mm"
} }
Text { Text {
text: "Tooltip format" text: "Alternate format (click to toggle)"
color: Qt.darker(root.foreground, 1.4) color: Qt.darker(root.foreground, 1.4)
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.bodySmall font.pixelSize: Style.font.bodySmall
} }
DaytimeField { ClockField {
fieldKey: "formatAlt" fieldKey: "formatAlt"
text: calForm.entry.formatAlt || "dd MMMM yyyy" text: clockForm.entry.formatAlt || "dd MMMM yyyy"
} }
Text { Text {
@@ -1214,9 +1214,9 @@ Item {
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.bodySmall font.pixelSize: Style.font.bodySmall
} }
DaytimeField { ClockField {
fieldKey: "verticalFormat" fieldKey: "verticalFormat"
text: calForm.entry.verticalFormat || "HH\n—\nmm" text: clockForm.entry.verticalFormat || "HH\n—\nmm"
} }
} }
} }
+2 -2
View File
@@ -7,7 +7,7 @@
"bar": { "bar": {
"position": "top", "position": "top",
"transparent": false, "transparent": false,
"centerAnchor": "daytime", "centerAnchor": "clock",
"layout": { "layout": {
"left": [ "left": [
{ {
@@ -19,7 +19,7 @@
], ],
"center": [ "center": [
{ {
"id": "daytime", "id": "clock",
"format": "dddd HH:mm", "format": "dddd HH:mm",
"formatAlt": "dd MMMM yyyy", "formatAlt": "dd MMMM yyyy",
"verticalFormat": "HH\n\u2014\nmm" "verticalFormat": "HH\n\u2014\nmm"
+3 -3
View File
@@ -44,10 +44,10 @@ ShellRoot {
bar: { bar: {
position: "top", position: "top",
transparent: false, transparent: false,
centerAnchor: "daytime", centerAnchor: "clock",
layout: { layout: {
left: [{ id: "omarchy" }, { id: "workspaces" }], left: [{ id: "omarchy" }, { id: "workspaces" }],
center: [{ id: "daytime", format: "dddd HH:mm" }], center: [{ id: "clock", format: "dddd HH:mm" }],
right: [{ id: "audioPanel" }] right: [{ id: "audioPanel" }]
} }
}, },
@@ -491,7 +491,7 @@ ShellRoot {
// Mirror plugin registry state into BarWidgetRegistry whenever it changes. // Mirror plugin registry state into BarWidgetRegistry whenever it changes.
// Each enabled plugin with kind "bar-widget" gets a Component created from // Each enabled plugin with kind "bar-widget" gets a Component created from
// its manifest entry point and registered under its plain manifest id. // its manifest entry point and registered under its plain manifest id.
// First-party widget ids (daytime, weather, etc.) are short and don't // First-party widget ids (clock, weather, etc.) are short and don't
// collide with namespaced plugin ids, so we don't need a separate // collide with namespaced plugin ids, so we don't need a separate
// "plugin:" namespace anymore. // "plugin:" namespace anymore.
Connections { Connections {