From 68129c5363bfa70937569e93c8ea0203ef3065d6 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 27 Jan 2026 14:47:20 +0000 Subject: [PATCH] Add battery module --- .config/waybar/config | 18 ++++++++++++++++ .config/waybar/style.css | 46 ++++++++++------------------------------ 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/.config/waybar/config b/.config/waybar/config index 6026047..264ebec 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -15,6 +15,7 @@ "modules-right": [ "tray", "pulseaudio", + "battery", "custom/power" ], @@ -56,6 +57,23 @@ "on-click-right": "pavucontrol" }, + "battery": { + "interval":2, + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-full": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} {time}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "custom/power":{ "format": "⏻", "tooltip": false, diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 99f579a..c933310 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -86,20 +86,10 @@ } /* --- Right Modules (Single, Seamless Bar ) --- */ -#pulseaudio { - background-color: @Buttons; - padding: 0.3rem 0.7rem; - margin: 5px 0px; - margin-right: 10px; - border-radius: 0; - box-shadow: none; - min-width: 0; - border: none; - transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; -} - #custom-power:hover, -#pulseaudio:hover { +#pulseaudio:hover, +#battery:hover, +#tray:hover { background-color: @Buttonshover; } @@ -112,25 +102,23 @@ font-weight: 500; } -#pulseaudio { + +#tray, #battery, #pulseaudio, #custom-power { background-color: @Buttons; color: @Text; border-radius: 10px; + padding: 0.5rem; + margin: 5px; + transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; } -#tray { +#pulseaudio { background-color: @Buttons; color: @Text; - border-top-right-radius: 10px; - border-top-left-radius: 10px; - border-bottom-right-radius: 10px; - border-bottom-left-radius: 10px; - padding: 0.3rem 0.7rem; - margin: 5px 0px; - margin-right: 10px; - + padding-right: 1rem; } + #battery { color: @Text; } @@ -141,18 +129,6 @@ color: @Text; } -#custom-power{ - background-color: @Buttons; - color: @Text; - border-top-right-radius: 10px; - border-top-left-radius: 10px; - border-bottom-right-radius: 10px; - border-bottom-left-radius: 10px; - padding: 0.3rem 0.7rem; - margin: 5px 0px; - margin-right: 20px; - transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; -} /* --- Tooltip Styles --- */ tooltip {