From a64c95e1803d9224f285187c9188961acdfe944e Mon Sep 17 00:00:00 2001 From: Dante <150515748+xsghetti@users.noreply.github.com> Date: Thu, 14 Mar 2024 00:57:29 -0400 Subject: [PATCH] battery / backlight update for laptops --- .config/waybar/config | 36 +++++++++++++++++++++++++++++------- .config/waybar/style.css | 19 +++++++++++-------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/.config/waybar/config b/.config/waybar/config index 28ea1d21..ea78cb24 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -1,6 +1,6 @@ { "layer": "top", // Waybar at top layer - // "output": ["DP-1"], + // "output": ["eDP-1"], "position": "top", // Waybar position (top|bottom|left|right) // "height": 30, // Waybar height (to be removed for auto height) // "width": 1280, // Waybar width @@ -8,7 +8,7 @@ // Choose the order of the modules "modules-left": ["custom/menu", "hyprland/workspaces", "custom/swaync", "custom/updates"], "modules-center": ["custom/playerctl", "custom/playerlabel"], - "modules-right": ["network", "pulseaudio", "clock", "tray", "custom/power"], + "modules-right": ["network", "pulseaudio", "clock", "tray", "battery", "backlight", "custom/power"], "keyboard-state": { "numlock": true, @@ -83,6 +83,28 @@ "format": "{temperatureC}°C {icon}", "format-icons": ["", "", ""] }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, "network": { // "interface": "wlp2*", // (Optional) To force the use of this interface "format-wifi": "󰤨 {essid}", @@ -141,19 +163,19 @@ "persistent-workspaces":{ "1": [ - "DP-1" + "eDP-1" ], "2": [ - "DP-1" + "eDP-1" ], "3": [ - "DP-1" + "eDP-1" ], "4": [ - "DP-1" + "eDP-1" ], "5": [ - "DP-1" + "eDP-1" ], "6": [ "HDMI-A-1" diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 1cb0acb2..f4a8feb0 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -65,7 +65,7 @@ tooltip label { border-bottom: 3px solid white; } -#clock, #idle_inhibitor, #network, #pulseaudio, #tray, #temperature{ +#clock, #idle_inhibitor, #network, #pulseaudio, #tray, #temperature, #battery, #backlight{ background-color: @color1; padding: 2px 10px; margin-top: 5px; @@ -74,11 +74,10 @@ tooltip label { color: @color7; border: 1.2px solid @color7; } -#custom-div{ - background-color: @color1; - margin-top: 3px; - margin-bottom: 3px; - +#backlight{ + border-radius: 4px; + margin-right: 2px; + margin-left: 4px; } #clock { padding-left: 15px; @@ -90,13 +89,17 @@ tooltip label { } #battery { - background-color: #ffffff; + background-color: @color7; color: black; + border: 1.2px solid @color7; + border-radius: 4px; + padding-top: 5px; + margin-left: 2px; } #battery.charging { color: white; - background-color: #26A65B; + background-color: @color1; } @keyframes blink {