diff --git a/bin/omarchy-update-available-reset b/bin/omarchy-update-available-reset index a72eb219..691f870b 100755 --- a/bin/omarchy-update-available-reset +++ b/bin/omarchy-update-available-reset @@ -2,5 +2,5 @@ # omarchy:summary=Ensure the status bar icon offering the available update is removed -omarchy-shell -q bar refreshUpdate +omarchy-shell -q systemUpdate refresh exit 0 diff --git a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml index af7401e4..cc87a348 100644 --- a/shell/plugins/bar/Bar.qml +++ b/shell/plugins/bar/Bar.qml @@ -54,7 +54,6 @@ Item { Behavior on foreground { ColorAnimation { duration: 420; easing.type: Easing.InOutCubic } } Behavior on background { ColorAnimation { duration: 420; easing.type: Easing.InOutCubic } } Behavior on urgent { ColorAnimation { duration: 420; easing.type: Easing.InOutCubic } } - property bool updateAvailable: false property bool clockAlt: false property var tooltipTarget: null property var pendingTooltipTarget: null @@ -259,7 +258,6 @@ Item { function builtinModuleComponent(name) { switch (String(name)) { case "clock": return clockModuleComponent - case "update": return updateModuleComponent case "indicators": return indicatorsModuleComponent case "tray": return trayModuleComponent default: return null @@ -366,10 +364,6 @@ Item { clearTooltip() } - function refreshUpdate() { - runProcess(updateProc) - } - function refreshIndicators() { indicatorsRefreshRequested() } @@ -459,23 +453,6 @@ Item { onFileChanged: barHiddenProbe.running = true } - Process { - id: updateProc - command: ["bash", "-lc", "omarchy-update-available"] - stdout: StdioCollector { waitForEnd: true } - onExited: function(exitCode) { - root.updateAvailable = exitCode === 0 - } - } - - Timer { - interval: 21600000 - running: true - repeat: true - triggeredOnStart: true - onTriggered: root.refreshUpdate() - } - Timer { interval: 2000 running: true @@ -487,10 +464,6 @@ Item { IpcHandler { target: "bar" - function refreshUpdate(): void { - root.refreshUpdate() - } - function refreshScreenRecording(): void { root.refreshIndicators() } @@ -646,7 +619,6 @@ Item { Component { id: emptyModuleComponent; Item { implicitWidth: 0; implicitHeight: 0; visible: false } } Component { id: clockModuleComponent; ClockModule {} } - Component { id: updateModuleComponent; UpdateModule {} } Component { id: indicatorsModuleComponent; IndicatorsModule {} } Component { id: trayModuleComponent; TrayModule {} } @@ -1385,13 +1357,6 @@ Item { } } - component UpdateModule: ModuleButton { - text: root.updateAvailable ? "" : "" - fontSize: Style.font.caption - tooltipText: root.updateAvailable ? "Omarchy update available" : "" - onPressed: function() { root.run("omarchy-launch-floating-terminal-with-presentation omarchy-update") } - } - component TrayModule: Item { id: trayRoot diff --git a/shell/plugins/bar/FirstPartyWidgets.qml b/shell/plugins/bar/FirstPartyWidgets.qml index 348885c7..21e2ca05 100644 --- a/shell/plugins/bar/FirstPartyWidgets.qml +++ b/shell/plugins/bar/FirstPartyWidgets.qml @@ -16,6 +16,7 @@ QtObject { "bluetoothPanel": { displayName: "Bluetooth", description: "Bluetooth device list with connect/disconnect", category: "Network", allowMultiple: false, sourceDir: "../panels", sourceName: "Bluetooth" }, "daytime": { displayName: "Daytime", description: "Day/time label with date tooltip", category: "Time", allowMultiple: false, settingsForm: "daytimeSettings" }, "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 }, "systemStats": { displayName: "System stats", description: "CPU icon — hover for graphs, click to open btop", category: "System", allowMultiple: false }, "weather": { displayName: "Weather", description: "Weather pill with detail popup", category: "Info", allowMultiple: false, settingsForm: "weatherSettings" }, "microphone": { displayName: "Microphone", description: "Mic input state and mute toggle", category: "Audio", allowMultiple: false }, diff --git a/shell/plugins/bar/README.md b/shell/plugins/bar/README.md index dc5f89f7..5a65118e 100644 --- a/shell/plugins/bar/README.md +++ b/shell/plugins/bar/README.md @@ -59,6 +59,7 @@ Example `shell.json` (bar subtree only shown): | `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 | | `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND | +| `systemUpdate` | Available update indicator | left = update | | `systemStats` | Inline CPU + memory sparklines, popup with detail | left = popup · right = terminal | | `weather` | Weather icon + popup with forecast | left = popup · right = full notification | | `microphone` | Mic icon + scroll volume | left = mute toggle · middle = audio panel · scroll = source volume | @@ -75,7 +76,7 @@ Example `shell.json` (bar subtree only shown): ### Built-in base modules (in `Bar.qml`) -`clock`, `update`, `indicators`, `tray`. +`clock`, `indicators`, `tray`. The `indicators` module loads individual bar indicators from `indicators/`, ordered by its `items` array in `shell.json`. Rich panels such as `powerPanel`, `networkPanel`, and `audioPanel` live in `../panels/` above. diff --git a/shell/plugins/bar/widgets/systemUpdate.qml b/shell/plugins/bar/widgets/systemUpdate.qml new file mode 100644 index 00000000..0af485fe --- /dev/null +++ b/shell/plugins/bar/widgets/systemUpdate.qml @@ -0,0 +1,54 @@ +import QtQuick +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Ui + +BarWidget { + id: root + moduleName: "systemUpdate" + + property bool updateAvailable: false + + function refresh() { + if (!updateProc.running) updateProc.running = true + } + + implicitWidth: button.implicitWidth + implicitHeight: button.implicitHeight + + IpcHandler { + target: "systemUpdate" + + function refresh(): void { + root.refresh() + } + } + + Process { + id: updateProc + command: ["bash", "-lc", "omarchy-update-available"] + stdout: StdioCollector { waitForEnd: true } + onExited: function(exitCode) { + root.updateAvailable = exitCode === 0 + } + } + + Timer { + interval: 21600000 + running: true + repeat: true + triggeredOnStart: true + onTriggered: root.refresh() + } + + WidgetButton { + id: button + anchors.fill: parent + bar: root.bar + text: root.updateAvailable ? "\uf021" : "" + fontSize: Style.font.caption + tooltipText: root.updateAvailable ? "Omarchy update available" : "" + onPressed: function() { root.bar.run("omarchy-launch-floating-terminal-with-presentation omarchy-update") } + } +} diff --git a/shell/plugins/settings/SettingsPanel.qml b/shell/plugins/settings/SettingsPanel.qml index a60c8585..67158823 100644 --- a/shell/plugins/settings/SettingsPanel.qml +++ b/shell/plugins/settings/SettingsPanel.qml @@ -133,7 +133,7 @@ Item { left: [{ id: "omarchy" }, { id: "workspaces" }], center: [ { id: "daytime", format: "dddd HH:mm", formatAlt: "dd MMMM yyyy", verticalFormat: "HH\n\u2014\nmm" }, - { id: "weather" }, { id: "indicators", items: [ "dnd", "nightlight", "stayAwake", "screenrecording", "dictation" ] }, { id: "update" } + { id: "weather" }, { id: "indicators", items: [ "dnd", "nightlight", "stayAwake", "screenrecording", "dictation" ] }, { id: "systemUpdate" } ], right: [ { id: "tray" }, { id: "bluetoothPanel" }, { id: "networkPanel" }, @@ -292,7 +292,6 @@ Item { // ---------------- widget catalog ----------------------------------------- readonly property var builtinWidgetMeta: ({ "clock": { name: "Clock", description: "Date / time text", category: "Time" }, - "update": { name: "Updates", description: "Indicates available system updates", category: "System" }, "indicators": { name: "Indicators", description: "Manual state indicators", category: "Status" }, "tray": { name: "System tray", description: "Status notifier items", category: "Status" } }) diff --git a/shell/shell-defaults.json b/shell/shell-defaults.json index e90f39da..3fe40160 100644 --- a/shell/shell-defaults.json +++ b/shell/shell-defaults.json @@ -38,7 +38,7 @@ ] }, { - "id": "update" + "id": "systemUpdate" } ], "right": [