From e0fc320dc6fe5d17ee189a225e33f7ee621076a5 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 14 Nov 2024 08:37:36 +0100 Subject: [PATCH] Add wifi quality widget (toaster-only) --- home/default.nix | 1 + home/qtile/src/bar.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/home/default.nix b/home/default.nix index 0bca613..dc775d5 100644 --- a/home/default.nix +++ b/home/default.nix @@ -45,6 +45,7 @@ # settings arandr brightnessctl + python3Packages.iwlib # messaging discord diff --git a/home/qtile/src/bar.py b/home/qtile/src/bar.py index 50a1c63..51a60ec 100644 --- a/home/qtile/src/bar.py +++ b/home/qtile/src/bar.py @@ -40,15 +40,32 @@ def mk_overrides(cls, **conf): ) CPUGraph = mk_overrides( - widget.CPUGraph, type="line", line_width=1, border_width=0 + widget.CPUGraph, + type="line", + line_width=1, + border_width=0 ) MemoryGraph = mk_overrides( - widget.MemoryGraph, type="line", graph_color="8B8AF1", line_width=1, border_width=0 + widget.MemoryGraph, + type="line", + graph_color="8B8AF1", + line_width=1, + border_width=0 ) Net = mk_overrides( - widget.Net, use_bits=True, format="{down:6.2f}{down_suffix:<2}↓↑{up:6.2f}{up_suffix:<2}" + widget.Net, + use_bits=True, + format="{down:6.2f}{down_suffix:<2}↓↑{up:6.2f}{up_suffix:<2}" +) + +# ip a | grep -oP '\d+:\s+w\w+(?=.*\sUP\s)' +# TODO: make it device agnostic +WifiQuality = mk_overrides( + widget.Wlan, + interface="wlp1s0", + format='{percent:2.0%}' ) GroupBox = mk_overrides( @@ -134,6 +151,7 @@ class Bar(bar.Bar): Mpris2, Battery, Net, + WifiQuality, Memory, MemoryGraph, CPUGraph,