Remove dead code
This commit is contained in:
+10
-13
@@ -222,6 +222,14 @@ Item {
|
||||
return index === -1 ? [] : entries.slice(index + 1)
|
||||
}
|
||||
|
||||
function canonicalWidgetId(name) {
|
||||
switch (String(name)) {
|
||||
case "idle": return "idleInhibitor"
|
||||
case "weatherFlyout": return "weather"
|
||||
default: return String(name)
|
||||
}
|
||||
}
|
||||
|
||||
function builtinModuleComponent(name) {
|
||||
switch (String(name)) {
|
||||
case "omarchy": return omarchyModuleComponent
|
||||
@@ -459,18 +467,6 @@ Item {
|
||||
return ids
|
||||
}
|
||||
|
||||
function activeTrayItemCount() {
|
||||
var count = 0
|
||||
var values = SystemTray.items.values
|
||||
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
if (values[i].status !== Status.Passive)
|
||||
count++
|
||||
}
|
||||
|
||||
return count
|
||||
}
|
||||
|
||||
function trayIconSource(icon) {
|
||||
var value = String(icon || "")
|
||||
var marker = "?path="
|
||||
@@ -939,7 +935,8 @@ Item {
|
||||
readonly property var registryComponent: {
|
||||
var w = root.barWidgetRegistry.widgets
|
||||
if (customType || builtinComponent) return null
|
||||
return w[moduleName] ? w[moduleName].component : null
|
||||
var registryName = root.canonicalWidgetId(moduleName)
|
||||
return w[registryName] ? w[registryName].component : null
|
||||
}
|
||||
readonly property bool qmlCustom: customType === "qml"
|
||||
readonly property bool commandCustom: customType === "command"
|
||||
|
||||
@@ -5,10 +5,9 @@ shipped as a first-party plugin of [`omarchy-shell`](../../README.md), the
|
||||
long-running shell host. The bar is mounted at startup and lives inside
|
||||
the shell for its whole session.
|
||||
|
||||
- `manifest.json` declares the plugin (`id: omarchy.bar`, `kind: bar`, `activation: persistent`) and points at `Bar.qml` as the entry point.
|
||||
- `manifest.json` declares the plugin (`id: omarchy.bar`, `kind: bar`) and points at `Bar.qml` as the entry point.
|
||||
- `Bar.qml` is Omarchy-owned bar engine code, loaded by the omarchy-shell host. Users should not edit it directly.
|
||||
- `widgets/` holds first-party widgets — modular, interactive components shipped with Omarchy.
|
||||
- `common/` holds shared QML helpers (buttons, sliders, popup cards).
|
||||
- The bar receives its config from the host shell as a `barConfig` property; the host loads it from `~/.config/omarchy/shell.json` (or `shell-defaults.json` when the user has no file).
|
||||
- `omarchy-style-bar-position` updates only the user shell.json file.
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
"version": "1.0.0",
|
||||
"author": "Omarchy",
|
||||
"description": "Status bar with widgets",
|
||||
"kinds": ["bar"],
|
||||
"activation": "persistent",
|
||||
"entryPoints": { "bar": "Bar.qml" }
|
||||
"kinds": [
|
||||
"bar"
|
||||
],
|
||||
"entryPoints": {
|
||||
"bar": "Bar.qml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ Item {
|
||||
var d = displays[selectedIndex]
|
||||
if (d) toggleDisplay(d.name, d.enabled)
|
||||
}
|
||||
// brightness: no semantic activation; the slider value is the action.
|
||||
// brightness: no separate action; the slider value is the action.
|
||||
}
|
||||
|
||||
function clampCursor() {
|
||||
@@ -222,18 +222,6 @@ Item {
|
||||
brightnessDebounce.restart()
|
||||
}
|
||||
|
||||
function toggleMirror() {
|
||||
if (!internalMonitor || !externalMonitor) return
|
||||
actionProc.command = ["bash", "-lc", "if hyprctl monitors -j | jq -e --arg i '" + internalMonitor + "' --arg e '" + externalMonitor + "' '.[] | select(.name == $i and .mirrorOf == $e)' >/dev/null; then hyprctl keyword monitor '" + internalMonitor + ",preferred,auto,auto'; else hyprctl keyword monitor '" + internalMonitor + ",preferred,auto,auto,mirror," + externalMonitor + "'; fi"]
|
||||
if (!actionProc.running) actionProc.running = true
|
||||
}
|
||||
|
||||
function toggleInternal() {
|
||||
if (!internalMonitor || !externalMonitor) return
|
||||
actionProc.command = ["bash", "-lc", "if hyprctl monitors -j | jq -e --arg i '" + internalMonitor + "' '.[] | select(.name == $i)' >/dev/null; then hyprctl keyword monitor '" + internalMonitor + ",disable'; else hyprctl keyword monitor '" + internalMonitor + ",preferred,auto,auto'; fi"]
|
||||
if (!actionProc.running) actionProc.running = true
|
||||
}
|
||||
|
||||
function normalizeScale(scale) {
|
||||
var n = parseFloat(String(scale || ""))
|
||||
if (!isFinite(n)) return ""
|
||||
|
||||
@@ -196,16 +196,6 @@ iwctl known-networks list 2>/dev/null \\
|
||||
Quickshell.execDetached(["bash", "-lc", "printf %s " + root.bar.shellQuote(value) + " | wl-copy"])
|
||||
}
|
||||
|
||||
function networkTooltip() {
|
||||
if (kind === "wifi") {
|
||||
var f = parseFloat(frequency)
|
||||
var ftext = f > 0 ? " (" + (f / 1000).toFixed(1) + " GHz)" : ""
|
||||
return (label || "Wi-Fi") + ftext
|
||||
}
|
||||
if (kind === "ethernet") return "Connected"
|
||||
return "Disconnected"
|
||||
}
|
||||
|
||||
function networkCommand() {
|
||||
return [
|
||||
"device=$(ip route get 1.1.1.1 2>/dev/null | awk '{ for (i = 1; i <= NF; i++) if ($i == \"dev\") { print $(i + 1); exit } }')",
|
||||
|
||||
@@ -14,16 +14,21 @@ Item {
|
||||
property bool popupOpen: false
|
||||
function closePopout() { popupOpen = false }
|
||||
|
||||
function showPopup() {
|
||||
root.popupOpen = !root.popupOpen
|
||||
if (root.popupOpen) root.refresh()
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "weather"
|
||||
function show(): void {
|
||||
root.popupOpen = !root.popupOpen
|
||||
if (root.popupOpen) root.refresh()
|
||||
}
|
||||
function show(): void { root.showPopup() }
|
||||
function toggle(): void { root.showPopup() }
|
||||
}
|
||||
|
||||
function toggle(): void {
|
||||
show()
|
||||
}
|
||||
IpcHandler {
|
||||
target: "weatherFlyout"
|
||||
function show(): void { root.showPopup() }
|
||||
function toggle(): void { root.showPopup() }
|
||||
}
|
||||
|
||||
// Parsed wttr.in j1 response. Kept on failure so stale data stays visible.
|
||||
@@ -58,8 +63,6 @@ Item {
|
||||
readonly property int refreshMinutes: Math.max(1, parseInt(setting("refreshMinutes", 15), 10) || 15)
|
||||
|
||||
readonly property string reportLocation: wttrLocation || (areaInfo && areaInfo.areaName && areaInfo.areaName[0] ? areaInfo.areaName[0].value : "")
|
||||
readonly property string reportCondition: current && current.weatherDesc && current.weatherDesc[0] ? current.weatherDesc[0].value : ""
|
||||
readonly property string reportTemp: current ? formatTemp(useImperial ? current.temp_F : current.temp_C) : ""
|
||||
readonly property string reportTempNum: current ? String(useImperial ? current.temp_F : current.temp_C) : ""
|
||||
readonly property string tempUnit: "°" + (useImperial ? "F" : "C")
|
||||
readonly property string reportFeels: current ? formatTemp(useImperial ? current.FeelsLikeF : current.FeelsLikeC) : ""
|
||||
@@ -164,16 +167,6 @@ Item {
|
||||
return Qt.formatDate(d, "dddd")
|
||||
}
|
||||
|
||||
function maxTempForDay(day) {
|
||||
if (!day) return ""
|
||||
return formatTemp(useImperial ? day.maxtempF : day.maxtempC)
|
||||
}
|
||||
|
||||
function minTempForDay(day) {
|
||||
if (!day) return ""
|
||||
return formatTemp(useImperial ? day.mintempF : day.mintempC)
|
||||
}
|
||||
|
||||
// Bare degree value (no unit letter), used in the forecast row.
|
||||
function bareTempForDay(day, kind) {
|
||||
if (!day) return ""
|
||||
|
||||
Reference in New Issue
Block a user