Remove dead code

This commit is contained in:
David Heinemeier Hansson
2026-05-19 10:50:36 +02:00
parent 8cd9e34294
commit 8fa463975a
36 changed files with 130 additions and 309 deletions
+1 -13
View File
@@ -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 } }')",
+12 -19
View File
@@ -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 ""