From c22a0856fc20b866602086f469262e5acbb6ec36 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 27 Aug 2026 18:26:36 +0530 Subject: desktop: updated network status in eww bar --- modules/desktop/eww/yuck.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/desktop/eww/yuck.nix') diff --git a/modules/desktop/eww/yuck.nix b/modules/desktop/eww/yuck.nix index 77d5949..8e7f197 100644 --- a/modules/desktop/eww/yuck.nix +++ b/modules/desktop/eww/yuck.nix @@ -17,6 +17,7 @@ meta.mainProgram = "eww-system-stats"; nativeBuildInputs = [ + pkgs.iw pkgs.wrapGAppsHook3 pkgs.gobject-introspection ]; @@ -92,7 +93,7 @@ (defpoll date :interval "60s" "date '+%d/%m'") (deflisten workspaces :initial "[]" "${lib.getExe workspaces}") (deflisten active-windows :initial "[]" "${lib.getExe activate-windows}") - (deflisten system_stats :initial "{\"cpu\":0,\"ram\":0,\"net\":\"down\"}" "${lib.getExe system-stats}") + (deflisten system_stats :initial "{\"cpu\":0,\"ram\":0,\"net\":{\"status\":\"down\",\"type\":\"\",\"iface\":\"\",\"speed\":\"\"}}" "${lib.getExe system-stats}") (defwindow bar :monitor 0 @@ -142,7 +143,13 @@ (defwidget system-widget [] (box :orientation "v" :space-evenly false :spacing 6 :halign "fill" :class "system" (box :orientation "v" :class "system-item" :halign "fill" :space-evenly false :spacing 4 - (image :class "system-icon" :path "${../../../assets/icons/bar/wifi.svg}" :image-width 24 :image-height 24)) + (image :class "system-icon" + :path "''${system_stats.net.status == 'down' ? '${../../../assets/icons/bar/offline.svg}' : system_stats.net.type == 'wifi' ? '${../../../assets/icons/bar/wifi.svg}' : system_stats.net.type == 'ethernet' ? '${../../../assets/icons/bar/ethernet.svg}' : '${../../../assets/icons/bar/offline.svg}'}" + :image-width 24 :image-height 24) + (label :class "system-label small" + :text "''${system_stats.net.tx != ''' ? system_stats.net.tx : '-'}") + (label :class "system-label small" + :text "''${system_stats.net.rx != ''' ? system_stats.net.rx : '-'}")) (box :orientation "v" :class "system-item" :space-evenly false :spacing 4 (image :class "system-icon" :path "${../../../assets/icons/bar/cpu.svg}" :image-width 24 :image-height 24) (label :class "system-label" :text "''${system_stats.cpu}%")) -- cgit v1.2.3