From 9cda8c2719662cec56657071821430c57e2eca03 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 31 Jul 2024 16:26:26 +0200 Subject: [PATCH] Color support for ping widget --- templates/ping.py.j2 | 4 ++-- templates/waybar.css.j2 | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/ping.py.j2 b/templates/ping.py.j2 index 4360f7b..fd630c0 100644 --- a/templates/ping.py.j2 +++ b/templates/ping.py.j2 @@ -28,13 +28,13 @@ def main(): status = { "text": "Online", "tooltip": "Internet connection is active", - "class": "online" + "class": "pingonline" } else: status = { "text": "Offline", "tooltip": "No internet connection", - "class": "offline" + "class": "pingoffline" } print(json.dumps(status)) sys.stdout.flush() diff --git a/templates/waybar.css.j2 b/templates/waybar.css.j2 index cb5bdda..6085294 100644 --- a/templates/waybar.css.j2 +++ b/templates/waybar.css.j2 @@ -281,10 +281,14 @@ label:focus { background-color: transparent; } -#custom-ping.connected { - color: #00FF00; /* Grün für verbunden */ +.pingonline { + color: white; + background-color: #2980b9; + padding: 0px 8px; } -#custom-ping.disconnected { - color: #FF0000; /* Rot für nicht verbunden */ +.pingoffline { + color: white; + background-color: #f53c3c; + padding: 0px 8px; }