diff --git a/shell/Ui/KeyboardPanel.qml b/shell/Ui/KeyboardPanel.qml index 7a52c1da..21404b77 100644 --- a/shell/Ui/KeyboardPanel.qml +++ b/shell/Ui/KeyboardPanel.qml @@ -16,7 +16,7 @@ import qs.Commons // API is a subset of Common.PopupCard: anchorItem, owner, bar, open, // padding, margin, contentWidth/Height, default contentItem. Missing on // purpose (for now): centerOnBar, triggerMode ("hover"), containsMouse. -// Hover-mode popups (system-stats, weather-flyout) and centered popups +// Hover-mode popups (system-stats, weather) and centered popups // (calendar week-view) need extra plumbing before migrating; converting // them is a follow-up. // diff --git a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml index b2e9e11e..b2a0d8bd 100644 --- a/shell/plugins/bar/Bar.qml +++ b/shell/plugins/bar/Bar.qml @@ -2,7 +2,6 @@ import Quickshell import Quickshell.Hyprland import Quickshell.Io import Quickshell.Services.SystemTray -import Quickshell.Services.UPower import Quickshell.Wayland import Quickshell.Widgets import QtQuick @@ -235,7 +234,6 @@ Item { case "notifications": case "notificationSilencing": return notificationsModuleComponent case "tray": return trayModuleComponent - case "battery": return batteryModuleComponent default: return null } } @@ -285,7 +283,7 @@ Item { "calendar": { displayName: "Calendar", description: "Clock with month-grid popup", category: "Time", allowMultiple: false, settingsForm: "calendarSettings" }, "notificationCenter": { displayName: "Notification center", description: "Recent notifications + DND", category: "Status", allowMultiple: false }, "systemStats": { displayName: "System stats", description: "CPU icon — hover for graphs, click to open btop", category: "System", allowMultiple: false }, - "weatherFlyout": { displayName: "Weather", description: "Weather pill with detail popup", category: "Info", allowMultiple: false, settingsForm: "weatherSettings" }, + "weather": { displayName: "Weather", description: "Weather pill with detail popup", category: "Info", allowMultiple: false, settingsForm: "weatherSettings" }, "idleInhibitor": { displayName: "Stay awake", description: "Toggle whether the system can idle", category: "System", allowMultiple: false }, "microphone": { displayName: "Microphone", description: "Mic input state and mute toggle", category: "Audio", allowMultiple: false }, "activeWindow": { displayName: "Active window", description: "Title of the focused window", category: "Compositor", allowMultiple: false }, @@ -473,28 +471,6 @@ Item { return count } - function batteryIcon() { - var device = UPower.displayDevice - if (!device || !device.isPresent) return "" - - var chargingIcons = ["󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"] - var defaultIcons = ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"] - var index = Math.max(0, Math.min(9, Math.floor(device.percentage * 10))) - - if (device.state === UPowerDeviceState.FullyCharged) return "󰂅" - if (!UPower.onBattery && device.state !== UPowerDeviceState.Charging) return "" - if (device.state === UPowerDeviceState.Charging) return chargingIcons[index] - return defaultIcons[index] - } - - function batteryTooltip() { - var device = UPower.displayDevice - if (!device || !device.isPresent) return "" - - var direction = UPower.onBattery ? "↓" : "↑" - return Math.round(device.changeRate) + "W" + direction + " " + Math.round(device.percentage * 100) + "%" - } - function trayIconSource(icon) { var value = String(icon || "") var marker = "?path=" @@ -789,7 +765,6 @@ Item { Component { id: screenRecordingModuleComponent; ScreenRecordingModule {} } Component { id: notificationsModuleComponent; NotificationsModule {} } Component { id: trayModuleComponent; TrayModule {} } - Component { id: batteryModuleComponent; BatteryModule {} } function findCenterAnchorEntry() { var entries = root.layoutEntries("center") @@ -1648,17 +1623,4 @@ Item { } } - component BatteryModule: ModuleButton { - property var device: UPower.displayDevice - - text: root.batteryIcon() - horizontalMargin: 8.5 - visible: device !== null && device.isPresent && device.percentage > 0 - active: device !== null && device.percentage <= 0.2 && UPower.onBattery - tooltipText: root.batteryTooltip() - onPressed: function(button) { - if (button === Qt.RightButton) root.run("omarchy-notification-send \"$(omarchy-battery-status)\"") - else root.run("omarchy-shell menu toggle power") - } - } } diff --git a/shell/plugins/bar/README.md b/shell/plugins/bar/README.md index 74906b6c..0e480304 100644 --- a/shell/plugins/bar/README.md +++ b/shell/plugins/bar/README.md @@ -62,15 +62,15 @@ Example `shell.json` (bar subtree only shown): | `calendar` | Clock + popup with month-grid calendar | left = popup · right = tz selector | | `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND | | `systemStats` | Inline CPU + memory sparklines, popup with detail | left = popup · right = terminal | -| `weatherFlyout` | Weather icon + popup with forecast | left = popup · right = full notification | +| `weather` | Weather icon + popup with forecast | left = popup · right = full notification | | `idleInhibitor` | Coffee-cup that toggles `omarchy-toggle-idle` | left = toggle | | `microphone` | Mic icon + scroll volume | left = mute toggle · middle = audio TUI · scroll = source volume | -### Built-in legacy modules (in `shell.qml`) +### Built-in base modules (in `Bar.qml`) -`omarchy`, `workspaces`, `clock`, `weather`, `update`, `voxtype`, `screenRecording`, `idle`, `notifications`, `tray`, `bluetooth`, `network`, `audio`, `cpu`, `battery`. +`omarchy`, `workspaces`, `clock`, `update`, `voxtype`, `screenRecording`, `notifications`, `tray`. -These remain available — set them in `layout` to use them instead of the richer widget versions. +These remain available for compact status/launcher slots. Rich panels such as `powerPanel`, `networkPanel`, and `audioPanel` live in `widgets/` above. ## Orientation diff --git a/shell/plugins/bar/widgets/weatherFlyout.qml b/shell/plugins/bar/widgets/weather.qml similarity index 99% rename from shell/plugins/bar/widgets/weatherFlyout.qml rename to shell/plugins/bar/widgets/weather.qml index ec32a87a..17d86e47 100644 --- a/shell/plugins/bar/widgets/weatherFlyout.qml +++ b/shell/plugins/bar/widgets/weather.qml @@ -8,14 +8,14 @@ Item { id: root property QtObject bar: null - property string moduleName: "weatherFlyout" + property string moduleName: "weather" property var settings: ({}) property bool popupOpen: false function closePopout() { popupOpen = false } IpcHandler { - target: "weatherFlyout" + target: "weather" function show(): void { root.popupOpen = !root.popupOpen if (root.popupOpen) root.refresh() diff --git a/shell/plugins/dev-gallery/GalleryPanel.qml b/shell/plugins/dev-gallery/GalleryPanel.qml index deca77b8..53df51ce 100644 --- a/shell/plugins/dev-gallery/GalleryPanel.qml +++ b/shell/plugins/dev-gallery/GalleryPanel.qml @@ -1531,7 +1531,7 @@ Item { width: Style.spacing.dropdownWidth label: "Center anchor" fontFamily: root.fontFamily - options: ["calendar", "weather", "clock", "battery"] + options: ["calendar", "weather", "clock", "powerPanel"] value: root.dropdownDemoValue hasCursor: root.focusSection === "dropdown" && root.selectedIndex === 0 onHovered: function(h) { @@ -1596,7 +1596,7 @@ Item { options: [ { value: "clock", label: "Clock", description: "Time + date display" }, { value: "weather", label: "Weather", description: "Local conditions and forecast" }, - { value: "battery", label: "Battery", description: "Charge level + power profile" }, + { value: "powerPanel", label: "Power", description: "Charge level + power profile" }, { value: "audio", label: "Audio", description: "Output sink + volume" }, { value: "network", label: "Network", description: "Wi-Fi + ethernet status" }, { value: "bluetooth", label: "Bluetooth", description: "Paired and nearby devices" }, diff --git a/shell/plugins/settings/SettingsPanel.qml b/shell/plugins/settings/SettingsPanel.qml index 68b0e765..4f15cde1 100644 --- a/shell/plugins/settings/SettingsPanel.qml +++ b/shell/plugins/settings/SettingsPanel.qml @@ -144,12 +144,12 @@ Item { left: [{ id: "omarchy" }, { id: "workspaces" }], center: [ { id: "calendar", format: "dddd HH:mm", formatAlt: "dd MMMM 'W'ww yyyy", verticalFormat: "HH\n\u2014\nmm" }, - { id: "weatherFlyout" }, { id: "update" }, { id: "voxtype" }, + { id: "weather" }, { id: "update" }, { id: "voxtype" }, { id: "screenRecording" }, { id: "idleInhibitor" }, { id: "notifications" } ], right: [ { id: "tray" }, { id: "bluetoothPanel" }, { id: "networkPanel" }, - { id: "audioPanel" }, { id: "monitorPanel" }, { id: "battery" } + { id: "audioPanel" }, { id: "monitorPanel" }, { id: "powerPanel" } ] } }, @@ -336,8 +336,7 @@ Item { "voxtype": { name: "Voxtype", description: "Voxtype dictation state", category: "Status" }, "screenRecording": { name: "Screen recording", description: "Active recording indicator", category: "Status" }, "notifications": { name: "DND", description: "Do-not-disturb indicator", category: "Status" }, - "tray": { name: "System tray", description: "Status notifier items", category: "Status" }, - "battery": { name: "Battery", description: "Battery percent and ETA", category: "System" } + "tray": { name: "System tray", description: "Status notifier items", category: "Status" } }) property int catalogRevision: 0 diff --git a/shell/shell-defaults.json b/shell/shell-defaults.json index c64f6f34..a8fc6c2b 100644 --- a/shell/shell-defaults.json +++ b/shell/shell-defaults.json @@ -21,7 +21,7 @@ "verticalFormat": "HH\n\u2014\nmm" }, { - "id": "weatherFlyout" + "id": "weather" }, { "id": "update"