mirror of
https://github.com/samjage/weather-and-stats.git
synced 2026-06-06 00:20:42 +00:00
fix: restore single-label layout, bump to 1.1, update docs
- Revert split RowLayout network section (broke icon rendering without Nerd Font); restore original single-label approach while keeping Cory's useNerdFont toggle and ic icon table fully intact - Bump version 1.0 → 1.1 - README: Nerd Font now listed as optional, add panel placement note, add useNerdFont to config table, clarify widget is panel/taskbar only
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Weather && Stats
|
||||
|
||||
A KDE Plasma 6 panel widget that displays live weather and system stats in a single compact bar.
|
||||
A KDE Plasma 6 **panel/taskbar widget** that displays live weather and system stats in a single compact bar. Designed to sit in your top or bottom panel — not a desktop widget.
|
||||
|
||||
 
|
||||
|
||||
@@ -20,8 +20,8 @@ All stats update on configurable intervals. Each section can be toggled on or of
|
||||
## Requirements
|
||||
|
||||
- KDE Plasma 6.0+
|
||||
- A [Nerd Font](https://www.nerdfonts.com/) set as your panel font (for icons)
|
||||
- `bash`, `free`, `/proc/stat`, `/proc/net/dev` (standard on any Linux system)
|
||||
- A [Nerd Font](https://www.nerdfonts.com/) set as your panel font is **optional** — the widget falls back to plain Unicode symbols if disabled in settings
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -34,6 +34,8 @@ kpackagetool6 --type Plasma/Applet --install weather-and-stats
|
||||
|
||||
Then right-click your panel → **Add Widgets** → search for **Weather && Stats**.
|
||||
|
||||
> **Placement:** Plasma always adds new widgets at a default position. After adding, right-click your panel → **Enter Edit Mode** and drag the widget to your preferred spot (e.g. left of the system tray). Plasma has no API for widgets to declare a position automatically.
|
||||
|
||||
### To update after changes
|
||||
|
||||
```bash
|
||||
@@ -54,6 +56,7 @@ Right-click the widget → **Configure Weather && Stats**:
|
||||
| CPU temp alert threshold | Temp at which the reading turns red | 80°C |
|
||||
| Stats refresh | How often to poll system stats (seconds) | 3 sec |
|
||||
| Visible stats | Toggle CPU temp, CPU usage, memory, network | All on |
|
||||
| Use Nerd Font icons | Use Nerd Font glyphs; disable for plain Unicode fallback | On |
|
||||
|
||||
## How it works
|
||||
|
||||
|
||||
+4
-41
@@ -66,12 +66,7 @@ PlasmoidItem {
|
||||
// ── Panel display ─────────────────────────────────────────────────────────
|
||||
preferredRepresentation: fullRepresentation
|
||||
|
||||
fullRepresentation: RowLayout {
|
||||
Layout.fillHeight: true
|
||||
spacing: 0
|
||||
|
||||
// ── Main label (weather + cpu/mem) ────────────────────────────────────
|
||||
PlasmaComponents.Label {
|
||||
fullRepresentation: PlasmaComponents.Label {
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: implicitWidth + 16
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@@ -97,43 +92,11 @@ PlasmoidItem {
|
||||
cpuMem.push(root.ic.mem + "\u00a0\u00a0" + (root.memUsage >= 0 ? padPct(root.memUsage) : "\u00a0--"))
|
||||
|
||||
if (cpuMem.length > 0) s += div + cpuMem.join(sp)
|
||||
if (root.showNetwork) s += div
|
||||
|
||||
return s
|
||||
}
|
||||
}
|
||||
if (root.showNetwork)
|
||||
s += div + root.ic.down + "\u00a0\u00a0" + formatNetSpeed(root.netDown) + sp + root.ic.up + "\u00a0\u00a0" + formatNetSpeed(root.netUp)
|
||||
|
||||
// ── Network ───────────────────────────────────────────────────────────
|
||||
// A hidden reference label measures the pixel width of the widest
|
||||
// possible value. Both visible labels are pinned to that exact width
|
||||
// (min = preferred = max) so content changes never affect their size.
|
||||
PlasmaComponents.Label {
|
||||
id: netRef
|
||||
visible: false
|
||||
font.family: "monospace"
|
||||
text: "000 MB/s"
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
visible: root.showNetwork
|
||||
font.family: "monospace"
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumWidth: netRef.implicitWidth
|
||||
Layout.preferredWidth: netRef.implicitWidth
|
||||
Layout.maximumWidth: netRef.implicitWidth
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: root.ic.down + " " + formatNetSpeed(root.netDown)
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
visible: root.showNetwork
|
||||
font.family: "monospace"
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumWidth: netRef.implicitWidth
|
||||
Layout.preferredWidth: netRef.implicitWidth
|
||||
Layout.maximumWidth: netRef.implicitWidth
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: " " + root.ic.up + " " + formatNetSpeed(root.netUp) + " "
|
||||
return s + " "
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"Description": "Live weather and system stats for the KDE panel",
|
||||
"Icon": "weather-clear",
|
||||
"Id": "com.github.samjage.weatherstats",
|
||||
"Version": "1.0",
|
||||
"Version": "1.1",
|
||||
"License": "GPL-2.0",
|
||||
"Category": "System Information",
|
||||
"Authors": [
|
||||
|
||||
Reference in New Issue
Block a user