From 79e1e782c48d552176d2e6047f4f26cd2ec7c446 Mon Sep 17 00:00:00 2001 From: oddlama Date: Fri, 12 Jul 2024 23:47:18 +0200 Subject: [PATCH] feat: add battery icon to waybar and add wifi status --- users/myuser/graphical/waybar-style.css | 17 ++++++++++------- users/myuser/graphical/waybar.nix | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/users/myuser/graphical/waybar-style.css b/users/myuser/graphical/waybar-style.css index dbae8b6..2d49ad9 100644 --- a/users/myuser/graphical/waybar-style.css +++ b/users/myuser/graphical/waybar-style.css @@ -91,29 +91,32 @@ button:hover { color: #000000; } -#battery { +#battery.charging { background-color: #ffffff; color: #000000; } -#battery.charging, -#battery.plugged { - background-color: #26A65B; +#battery.plugged:not(.charging) { + background-color: #2980b9; } @keyframes blink { to { - background-color: #ffffff; - color: #000000; + background-color: #000000; } } /* Using steps() instead of linear as a timing function to limit cpu usage */ +#battery.warning:not(.charging) { + background-color: #f1c40f; + color: #000000; +} + #battery.critical:not(.charging) { background-color: #e05f65; animation-name: blink; animation-duration: 0.5s; - animation-timing-function: steps(12); + animation-timing-function: step-start; animation-iteration-count: infinite; animation-direction: alternate; } diff --git a/users/myuser/graphical/waybar.nix b/users/myuser/graphical/waybar.nix index 063f7ab..576bfda 100644 --- a/users/myuser/graphical/waybar.nix +++ b/users/myuser/graphical/waybar.nix @@ -42,7 +42,7 @@ #"temperature" "cpu" "memory" - #"battery" + "battery" "custom/notification" "clock" @@ -119,6 +119,16 @@ # escape = true; #}; + battery = { + interval = 2; + format = "{icon} {capacity}%"; + format-icons = ["" "" "" "" "" "" "" "" ""]; + states = { + warning = 25; + critical = 15; + }; + }; + privacy = { icon-spacing = 4; icon-size = 18; @@ -200,7 +210,8 @@ network = { interval = 5; format-ethernet = "󰈀 {ipaddr}/{cidr} ↓ {bandwidthDownBytes} ↑ {bandwidthUpBytes}"; - format-disconnected = "⚠ Disconnected"; + format-wifi = " {signalStrength}% {essid} {ipaddr}/{cidr} ↓ {bandwidthDownBytes} ↑ {bandwidthUpBytes}"; + format-disconnected = "⚠ Disconnected"; tooltip-format = "↑ {bandwidthUpBytes}\n↓ {bandwidthDownBytes}"; };