Remove legacy battery bar module

This commit is contained in:
Ryan Hughes
2026-05-18 21:27:00 -04:00
parent 6fa6e6cc91
commit f1e6fe86b7
7 changed files with 14 additions and 53 deletions
+1 -39
View File
@@ -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")
}
}
}
+4 -4
View File
@@ -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
@@ -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()