diff --git a/resources/style.css b/resources/style.css index 3d9474bb..4fa2226d 100644 --- a/resources/style.css +++ b/resources/style.css @@ -42,9 +42,21 @@ window { background-color: #26A65B; } +@keyframes blink { + to { + background-color: #ffffff; + color: black; + } +} + .battery.warning { background: #f53c3c; color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; } .cpu { diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 060e4dd6..97a8c9bf 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -50,7 +50,7 @@ auto waybar::modules::Battery::update() -> void _label.get_style_context()->add_class("charging"); else _label.get_style_context()->remove_class("charging"); - if (value < 52 && !charging) + if (value < 16 && !charging) _label.get_style_context()->add_class("warning"); else _label.get_style_context()->remove_class("warning");