diff --git a/quickshell/modules/desktop/SystemWidget.qml b/quickshell/modules/desktop/SystemWidget.qml index a9822c2..cb154ef 100644 --- a/quickshell/modules/desktop/SystemWidget.qml +++ b/quickshell/modules/desktop/SystemWidget.qml @@ -267,10 +267,10 @@ PanelWindow { ColumnLayout { anchors.fill: parent anchors.margins: 12 - spacing: 4 + spacing: 6 Text { - text: "🌡️ Sensors & Net" + text: "🌡️ Sensors & Network" color: Theme.fg font.pixelSize: 12 font.weight: Font.Bold @@ -278,33 +278,82 @@ PanelWindow { RowLayout { Layout.fillWidth: true - Text { text: "💾 NVMe: " + SystemMonitorService.nvmeTemp + "°C"; color: Theme.cyan; font.pixelSize: 10; font.weight: Font.Bold } + spacing: 4 + + RowLayout { + spacing: 4 + Text { text: "💾 NVMe:"; color: Theme.comment; font.pixelSize: 10; font.weight: Font.Bold } + Text { text: SystemMonitorService.nvmeTemp + "°C"; color: Theme.cyan; font.pixelSize: 10; font.weight: Font.Bold } + } + Item { Layout.fillWidth: true } - Text { text: "📶 Wi-Fi: " + SystemMonitorService.wifiTemp + "°C"; color: Theme.yellow; font.pixelSize: 10; font.weight: Font.Bold } + + RowLayout { + spacing: 4 + Text { text: "📶 Wi-Fi:"; color: Theme.comment; font.pixelSize: 10; font.weight: Font.Bold } + Text { text: SystemMonitorService.wifiSignal; color: Theme.subAccent; font.pixelSize: 10; font.weight: Font.Bold } + } } RowLayout { Layout.fillWidth: true - Text { text: "⬇ " + SystemMonitorService.netRx; color: Theme.green; font.pixelSize: 10; font.weight: Font.Bold } + spacing: 4 + + RowLayout { + spacing: 4 + Text { text: "⬇ Net:"; color: Theme.comment; font.pixelSize: 10; font.weight: Font.Bold } + Text { text: SystemMonitorService.netRx; color: Theme.green; font.pixelSize: 10; font.weight: Font.Bold } + } + Item { Layout.fillWidth: true } - Text { text: "⬆ " + SystemMonitorService.netTx; color: Theme.subAccent; font.pixelSize: 10; font.weight: Font.Bold } + + RowLayout { + spacing: 4 + Text { text: "⬆ Up:"; color: Theme.comment; font.pixelSize: 10; font.weight: Font.Bold } + Text { text: SystemMonitorService.netTx; color: Theme.purple; font.pixelSize: 10; font.weight: Font.Bold } + } } - Text { text: "🔥 " + SystemMonitorService.topProc + " (" + SystemMonitorService.procCount + " procs)"; color: Theme.pink; font.pixelSize: 10 } - - // Disk Usage Gauge Bar - Rectangle { + RowLayout { Layout.fillWidth: true - height: 6 - radius: 3 - color: Theme.bg + spacing: 4 + Text { text: "🔥 Top:"; color: Theme.comment; font.pixelSize: 10; font.weight: Font.Bold } + Text { + text: SystemMonitorService.topProc + " (" + SystemMonitorService.procCount + " procs)" + color: Theme.pink + font.pixelSize: 10 + elide: Text.ElideRight + Layout.fillWidth: true + } + } + + Item { Layout.fillHeight: true } + + // Storage Gauge Bar + ColumnLayout { + Layout.fillWidth: true + spacing: 3 + + RowLayout { + Layout.fillWidth: true + Text { text: "Storage"; color: Theme.comment; font.pixelSize: 9 } + Item { Layout.fillWidth: true } + Text { text: SystemMonitorService.diskUsed + " / " + SystemMonitorService.diskTotal + " GB (" + SystemMonitorService.diskPct + "%)"; color: Theme.yellow; font.pixelSize: 9 } + } Rectangle { - height: parent.height - width: parent.width * (SystemMonitorService.diskPct / 100.0) + Layout.fillWidth: true + height: 6 radius: 3 - color: Theme.yellow - Behavior on width { NumberAnimation { duration: 300 } } + color: Theme.bg + + Rectangle { + height: parent.height + width: parent.width * (SystemMonitorService.diskPct / 100.0) + radius: 3 + color: Theme.accent + Behavior on width { NumberAnimation { duration: 300 } } + } } } } diff --git a/quickshell/services/SystemMonitorService.qml b/quickshell/services/SystemMonitorService.qml index 722848b..662e2bb 100644 --- a/quickshell/services/SystemMonitorService.qml +++ b/quickshell/services/SystemMonitorService.qml @@ -23,6 +23,7 @@ Item { property real nvmeTemp: 0.0 property real wifiTemp: 0.0 + property string wifiSignal: "100%" property real ramUsed: 0.0 property real ramTotal: 30.6 @@ -69,6 +70,7 @@ Item { if (parsed.nvme_temp !== undefined) root.nvmeTemp = parsed.nvme_temp if (parsed.wifi_temp !== undefined) root.wifiTemp = parsed.wifi_temp + if (parsed.wifi_signal !== undefined) root.wifiSignal = parsed.wifi_signal if (parsed.ram_used !== undefined) root.ramUsed = parsed.ram_used if (parsed.ram_total !== undefined) root.ramTotal = parsed.ram_total diff --git a/quickshell/services/python/system_monitor_service.py b/quickshell/services/python/system_monitor_service.py index 049975d..012bafc 100644 --- a/quickshell/services/python/system_monitor_service.py +++ b/quickshell/services/python/system_monitor_service.py @@ -118,6 +118,20 @@ def get_top_process_and_count(): pass return top_proc, proc_count +def get_wifi_signal(): + try: + if os.path.exists('/proc/net/wireless'): + with open('/proc/net/wireless', 'r') as f: + lines = f.readlines() + if len(lines) > 2: + parts = lines[2].split() + link_quality = float(parts[2].rstrip('.')) + pct = min(100, int((link_quality / 70.0) * 100)) + return f"{pct}%" + except Exception: + pass + return "100%" + def get_hardware_metrics(): hw = { "cpu_temp": 0.0, @@ -129,7 +143,8 @@ def get_hardware_metrics(): "gpu_power": "20W / 78W", "gpu_fan": 0, "nvme_temp": 0.0, - "wifi_temp": 0.0 + "wifi_temp": 0.0, + "wifi_signal": get_wifi_signal() } # NVIDIA GPU metrics via nvidia-smi @@ -277,6 +292,7 @@ def stream_stats(): "gpu_history": list(gpu_history), "nvme_temp": hw["nvme_temp"], "wifi_temp": hw["wifi_temp"], + "wifi_signal": hw["wifi_signal"], "ram_used": ram_used, "ram_total": ram_total, "ram_pct": ram_pct,