mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
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:
+4
-4
@@ -168,10 +168,10 @@ rewrites the `bar` subtree from the current `shell-defaults.json`.
|
||||
"bar": {
|
||||
"position": "top",
|
||||
"transparent": false,
|
||||
"centerAnchor": "daytime",
|
||||
"centerAnchor": "clock",
|
||||
"layout": {
|
||||
"left": [ { "id": "omarchy" }, { "id": "workspaces" } ],
|
||||
"center": [ { "id": "daytime", "format": "HH:mm" } ],
|
||||
"center": [ { "id": "clock", "format": "HH:mm" } ],
|
||||
"right": [
|
||||
{ "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
|
||||
with the shell IPC. First-party plugins are always enabled.
|
||||
4. **Multiple instances** are allowed when a manifest sets
|
||||
`allowMultiple: true`. Each instance is independent — e.g. two daytime
|
||||
widgets in different timezones are just two `{"id":"daytime", "timezone": ...}`
|
||||
`allowMultiple: true`. Each instance is independent — e.g. two clock
|
||||
widgets in different timezones are just two `{"id":"clock", "timezone": ...}`
|
||||
entries with their own values.
|
||||
5. **Idle timings are top-level.** `idle.screensaver` and `idle.lock`
|
||||
are seconds since user idle began, so the default lock fires at 300s
|
||||
|
||||
@@ -31,7 +31,7 @@ Item {
|
||||
property var fallbackBarConfig: ({
|
||||
position: "top",
|
||||
transparent: false,
|
||||
centerAnchor: "daytime",
|
||||
centerAnchor: "clock",
|
||||
layout: { left: [], center: [], right: [] }
|
||||
})
|
||||
property var layoutConfig: fallbackBarConfig.layout
|
||||
|
||||
@@ -14,8 +14,7 @@ QtObject {
|
||||
"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" },
|
||||
"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 },
|
||||
"daytime": { displayName: "Daytime", description: "Day/time label with date tooltip", category: "Time", allowMultiple: false, settingsForm: "daytimeSettings" },
|
||||
"clock": { displayName: "Clock", description: "Day/time label; click to toggle alternate format", category: "Time", allowMultiple: false, settingsForm: "clockSettings" },
|
||||
"indicators": { displayName: "Indicators", description: "Manual state indicators", 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 },
|
||||
|
||||
@@ -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.
|
||||
|
||||
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):
|
||||
|
||||
@@ -26,7 +26,7 @@ Example `shell.json` (bar subtree only shown):
|
||||
"bar": {
|
||||
"position": "top",
|
||||
"transparent": false,
|
||||
"centerAnchor": "daytime",
|
||||
"centerAnchor": "clock",
|
||||
"layout": {
|
||||
"left": [
|
||||
{ "id": "omarchy" },
|
||||
@@ -35,7 +35,7 @@ Example `shell.json` (bar subtree only shown):
|
||||
],
|
||||
"center": [
|
||||
{ "id": "media" },
|
||||
{ "id": "daytime", "format": "HH:mm" }
|
||||
{ "id": "clock", "format": "HH:mm" }
|
||||
],
|
||||
"right": [
|
||||
{ "id": "audioPanel" },
|
||||
@@ -58,7 +58,6 @@ Example `shell.json` (bar subtree only shown):
|
||||
| `workspaces` | Hyprland workspace switcher | left = focus workspace |
|
||||
| `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 |
|
||||
| `daytime` | Day/time label with date tooltip | hover = date |
|
||||
| `indicators` | Manual state indicators | left = indicator action |
|
||||
| `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND |
|
||||
| `systemUpdate` | Available update indicator | left = update |
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ Item {
|
||||
property string choiceDemoValue: "top"
|
||||
property bool toggleDemoOn: true
|
||||
property bool toggleSquareOn: false
|
||||
property string dropdownDemoValue: "daytime"
|
||||
property string dropdownDemoValue: "clock"
|
||||
property string searchableDemoValue: ""
|
||||
property int numberDemoValue: 15
|
||||
|
||||
@@ -1523,7 +1523,7 @@ Item {
|
||||
width: Style.spacing.dropdownWidth
|
||||
label: "Center anchor"
|
||||
fontFamily: root.fontFamily
|
||||
options: ["daytime", "weather", "clock", "powerPanel"]
|
||||
options: ["clock", "weather", "powerPanel"]
|
||||
value: root.dropdownDemoValue
|
||||
hasCursor: root.focusSection === "dropdown" && root.selectedIndex === 0
|
||||
onHovered: function(h) {
|
||||
@@ -1593,7 +1593,6 @@ Item {
|
||||
{ value: "network", label: "Network", description: "Wi-Fi + ethernet status" },
|
||||
{ value: "bluetooth", label: "Bluetooth", description: "Paired and nearby devices" },
|
||||
{ value: "monitor", label: "Monitor", description: "Brightness + scale" },
|
||||
{ value: "daytime", label: "Daytime", description: "Day/time label" },
|
||||
{ value: "media", label: "Media", description: "Now-playing + transport" },
|
||||
{ value: "workspaces", label: "Workspaces", description: "Hyprland workspace pills" },
|
||||
{ value: "system-tray", label: "System tray", description: "StatusNotifierItem icons" },
|
||||
|
||||
@@ -128,11 +128,11 @@ Item {
|
||||
bar: {
|
||||
position: "top",
|
||||
transparent: false,
|
||||
centerAnchor: "daytime",
|
||||
centerAnchor: "clock",
|
||||
layout: {
|
||||
left: [{ id: "omarchy" }, { id: "workspaces" }],
|
||||
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" }
|
||||
],
|
||||
right: [
|
||||
@@ -145,7 +145,7 @@ Item {
|
||||
})
|
||||
|
||||
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 bool suppressReload: false
|
||||
|
||||
@@ -1124,7 +1124,7 @@ Item {
|
||||
if (meta && meta.settingsForm) {
|
||||
switch (meta.settingsForm) {
|
||||
case "spacerSettings": return spacerSettingsComponent
|
||||
case "daytimeSettings": return daytimeSettingsComponent
|
||||
case "clockSettings": return clockSettingsComponent
|
||||
case "weatherSettings": return weatherSettingsComponent
|
||||
}
|
||||
}
|
||||
@@ -1166,24 +1166,24 @@ Item {
|
||||
}
|
||||
|
||||
Component {
|
||||
id: daytimeSettingsComponent
|
||||
id: clockSettingsComponent
|
||||
|
||||
Column {
|
||||
id: calForm
|
||||
id: clockForm
|
||||
signal fieldChanged(string key, var value)
|
||||
property var entry: ({})
|
||||
|
||||
spacing: Style.spacing.rowGap
|
||||
width: parent ? parent.width : 0
|
||||
|
||||
component DaytimeField: TextField {
|
||||
component ClockField: TextField {
|
||||
property string fieldKey: ""
|
||||
width: parent.width
|
||||
foreground: root.foreground
|
||||
accent: root.accent
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.body
|
||||
onEditingFinished: if (fieldKey) calForm.fieldChanged(fieldKey, text)
|
||||
onEditingFinished: if (fieldKey) clockForm.fieldChanged(fieldKey, text)
|
||||
}
|
||||
|
||||
Text {
|
||||
@@ -1192,20 +1192,20 @@ Item {
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
}
|
||||
DaytimeField {
|
||||
ClockField {
|
||||
fieldKey: "format"
|
||||
text: calForm.entry.format || "dddd HH:mm"
|
||||
text: clockForm.entry.format || "dddd HH:mm"
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Tooltip format"
|
||||
text: "Alternate format (click to toggle)"
|
||||
color: Qt.darker(root.foreground, 1.4)
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
}
|
||||
DaytimeField {
|
||||
ClockField {
|
||||
fieldKey: "formatAlt"
|
||||
text: calForm.entry.formatAlt || "dd MMMM yyyy"
|
||||
text: clockForm.entry.formatAlt || "dd MMMM yyyy"
|
||||
}
|
||||
|
||||
Text {
|
||||
@@ -1214,9 +1214,9 @@ Item {
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
}
|
||||
DaytimeField {
|
||||
ClockField {
|
||||
fieldKey: "verticalFormat"
|
||||
text: calForm.entry.verticalFormat || "HH\n—\nmm"
|
||||
text: clockForm.entry.verticalFormat || "HH\n—\nmm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"bar": {
|
||||
"position": "top",
|
||||
"transparent": false,
|
||||
"centerAnchor": "daytime",
|
||||
"centerAnchor": "clock",
|
||||
"layout": {
|
||||
"left": [
|
||||
{
|
||||
@@ -19,7 +19,7 @@
|
||||
],
|
||||
"center": [
|
||||
{
|
||||
"id": "daytime",
|
||||
"id": "clock",
|
||||
"format": "dddd HH:mm",
|
||||
"formatAlt": "dd MMMM yyyy",
|
||||
"verticalFormat": "HH\n\u2014\nmm"
|
||||
|
||||
+3
-3
@@ -44,10 +44,10 @@ ShellRoot {
|
||||
bar: {
|
||||
position: "top",
|
||||
transparent: false,
|
||||
centerAnchor: "daytime",
|
||||
centerAnchor: "clock",
|
||||
layout: {
|
||||
left: [{ id: "omarchy" }, { id: "workspaces" }],
|
||||
center: [{ id: "daytime", format: "dddd HH:mm" }],
|
||||
center: [{ id: "clock", format: "dddd HH:mm" }],
|
||||
right: [{ id: "audioPanel" }]
|
||||
}
|
||||
},
|
||||
@@ -491,7 +491,7 @@ ShellRoot {
|
||||
// Mirror plugin registry state into BarWidgetRegistry whenever it changes.
|
||||
// Each enabled plugin with kind "bar-widget" gets a Component created from
|
||||
// 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
|
||||
// "plugin:" namespace anymore.
|
||||
Connections {
|
||||
|
||||
Reference in New Issue
Block a user