Remove legacy battery bar module
This commit is contained in:
@@ -16,7 +16,7 @@ import qs.Commons
|
|||||||
// API is a subset of Common.PopupCard: anchorItem, owner, bar, open,
|
// API is a subset of Common.PopupCard: anchorItem, owner, bar, open,
|
||||||
// padding, margin, contentWidth/Height, default contentItem. Missing on
|
// padding, margin, contentWidth/Height, default contentItem. Missing on
|
||||||
// purpose (for now): centerOnBar, triggerMode ("hover"), containsMouse.
|
// 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
|
// (calendar week-view) need extra plumbing before migrating; converting
|
||||||
// them is a follow-up.
|
// them is a follow-up.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import Quickshell
|
|||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Services.SystemTray
|
import Quickshell.Services.SystemTray
|
||||||
import Quickshell.Services.UPower
|
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
@@ -235,7 +234,6 @@ Item {
|
|||||||
case "notifications":
|
case "notifications":
|
||||||
case "notificationSilencing": return notificationsModuleComponent
|
case "notificationSilencing": return notificationsModuleComponent
|
||||||
case "tray": return trayModuleComponent
|
case "tray": return trayModuleComponent
|
||||||
case "battery": return batteryModuleComponent
|
|
||||||
default: return null
|
default: return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,7 +283,7 @@ Item {
|
|||||||
"calendar": { displayName: "Calendar", description: "Clock with month-grid popup", category: "Time", allowMultiple: false, settingsForm: "calendarSettings" },
|
"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 },
|
"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 },
|
"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 },
|
"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 },
|
"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 },
|
"activeWindow": { displayName: "Active window", description: "Title of the focused window", category: "Compositor", allowMultiple: false },
|
||||||
@@ -473,28 +471,6 @@ Item {
|
|||||||
return count
|
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) {
|
function trayIconSource(icon) {
|
||||||
var value = String(icon || "")
|
var value = String(icon || "")
|
||||||
var marker = "?path="
|
var marker = "?path="
|
||||||
@@ -789,7 +765,6 @@ Item {
|
|||||||
Component { id: screenRecordingModuleComponent; ScreenRecordingModule {} }
|
Component { id: screenRecordingModuleComponent; ScreenRecordingModule {} }
|
||||||
Component { id: notificationsModuleComponent; NotificationsModule {} }
|
Component { id: notificationsModuleComponent; NotificationsModule {} }
|
||||||
Component { id: trayModuleComponent; TrayModule {} }
|
Component { id: trayModuleComponent; TrayModule {} }
|
||||||
Component { id: batteryModuleComponent; BatteryModule {} }
|
|
||||||
|
|
||||||
function findCenterAnchorEntry() {
|
function findCenterAnchorEntry() {
|
||||||
var entries = root.layoutEntries("center")
|
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,15 +62,15 @@ Example `shell.json` (bar subtree only shown):
|
|||||||
| `calendar` | Clock + popup with month-grid calendar | left = popup · right = tz selector |
|
| `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 |
|
| `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 |
|
| `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 |
|
| `idleInhibitor` | Coffee-cup that toggles `omarchy-toggle-idle` | left = toggle |
|
||||||
| `microphone` | Mic icon + scroll volume | left = mute toggle · middle = audio TUI · scroll = source volume |
|
| `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
|
## Orientation
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property QtObject bar: null
|
property QtObject bar: null
|
||||||
property string moduleName: "weatherFlyout"
|
property string moduleName: "weather"
|
||||||
property var settings: ({})
|
property var settings: ({})
|
||||||
|
|
||||||
property bool popupOpen: false
|
property bool popupOpen: false
|
||||||
function closePopout() { popupOpen = false }
|
function closePopout() { popupOpen = false }
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
target: "weatherFlyout"
|
target: "weather"
|
||||||
function show(): void {
|
function show(): void {
|
||||||
root.popupOpen = !root.popupOpen
|
root.popupOpen = !root.popupOpen
|
||||||
if (root.popupOpen) root.refresh()
|
if (root.popupOpen) root.refresh()
|
||||||
@@ -1531,7 +1531,7 @@ Item {
|
|||||||
width: Style.spacing.dropdownWidth
|
width: Style.spacing.dropdownWidth
|
||||||
label: "Center anchor"
|
label: "Center anchor"
|
||||||
fontFamily: root.fontFamily
|
fontFamily: root.fontFamily
|
||||||
options: ["calendar", "weather", "clock", "battery"]
|
options: ["calendar", "weather", "clock", "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) {
|
||||||
@@ -1596,7 +1596,7 @@ Item {
|
|||||||
options: [
|
options: [
|
||||||
{ value: "clock", label: "Clock", description: "Time + date display" },
|
{ value: "clock", label: "Clock", description: "Time + date display" },
|
||||||
{ value: "weather", label: "Weather", description: "Local conditions and forecast" },
|
{ 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: "audio", label: "Audio", description: "Output sink + volume" },
|
||||||
{ 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" },
|
||||||
|
|||||||
@@ -144,12 +144,12 @@ Item {
|
|||||||
left: [{ id: "omarchy" }, { id: "workspaces" }],
|
left: [{ id: "omarchy" }, { id: "workspaces" }],
|
||||||
center: [
|
center: [
|
||||||
{ id: "calendar", format: "dddd HH:mm", formatAlt: "dd MMMM 'W'ww yyyy", verticalFormat: "HH\n\u2014\nmm" },
|
{ 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" }
|
{ id: "screenRecording" }, { id: "idleInhibitor" }, { id: "notifications" }
|
||||||
],
|
],
|
||||||
right: [
|
right: [
|
||||||
{ id: "tray" }, { id: "bluetoothPanel" }, { id: "networkPanel" },
|
{ 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" },
|
"voxtype": { name: "Voxtype", description: "Voxtype dictation state", category: "Status" },
|
||||||
"screenRecording": { name: "Screen recording", description: "Active recording indicator", category: "Status" },
|
"screenRecording": { name: "Screen recording", description: "Active recording indicator", category: "Status" },
|
||||||
"notifications": { name: "DND", description: "Do-not-disturb indicator", category: "Status" },
|
"notifications": { name: "DND", description: "Do-not-disturb indicator", category: "Status" },
|
||||||
"tray": { name: "System tray", description: "Status notifier items", category: "Status" },
|
"tray": { name: "System tray", description: "Status notifier items", category: "Status" }
|
||||||
"battery": { name: "Battery", description: "Battery percent and ETA", category: "System" }
|
|
||||||
})
|
})
|
||||||
|
|
||||||
property int catalogRevision: 0
|
property int catalogRevision: 0
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"verticalFormat": "HH\n\u2014\nmm"
|
"verticalFormat": "HH\n\u2014\nmm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "weatherFlyout"
|
"id": "weather"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "update"
|
"id": "update"
|
||||||
|
|||||||
Reference in New Issue
Block a user