battery / backlight update for laptops

This commit is contained in:
Dante 2024-03-14 00:57:29 -04:00 committed by GitHub
parent 55bc00bf01
commit a64c95e180
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 15 deletions

View file

@ -1,6 +1,6 @@
{ {
"layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
// "output": ["DP-1"], // "output": ["eDP-1"],
"position": "top", // Waybar position (top|bottom|left|right) "position": "top", // Waybar position (top|bottom|left|right)
// "height": 30, // Waybar height (to be removed for auto height) // "height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width // "width": 1280, // Waybar width
@ -8,7 +8,7 @@
// Choose the order of the modules // Choose the order of the modules
"modules-left": ["custom/menu", "hyprland/workspaces", "custom/swaync", "custom/updates"], "modules-left": ["custom/menu", "hyprland/workspaces", "custom/swaync", "custom/updates"],
"modules-center": ["custom/playerctl", "custom/playerlabel"], "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": { "keyboard-state": {
"numlock": true, "numlock": true,
@ -83,6 +83,28 @@
"format": "{temperatureC}°C {icon}", "format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""] "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": { "network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface // "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "󰤨 {essid}", "format-wifi": "󰤨 {essid}",
@ -141,19 +163,19 @@
"persistent-workspaces":{ "persistent-workspaces":{
"1": [ "1": [
"DP-1" "eDP-1"
], ],
"2": [ "2": [
"DP-1" "eDP-1"
], ],
"3": [ "3": [
"DP-1" "eDP-1"
], ],
"4": [ "4": [
"DP-1" "eDP-1"
], ],
"5": [ "5": [
"DP-1" "eDP-1"
], ],
"6": [ "6": [
"HDMI-A-1" "HDMI-A-1"

View file

@ -65,7 +65,7 @@ tooltip label {
border-bottom: 3px solid white; border-bottom: 3px solid white;
} }
#clock, #idle_inhibitor, #network, #pulseaudio, #tray, #temperature{ #clock, #idle_inhibitor, #network, #pulseaudio, #tray, #temperature, #battery, #backlight{
background-color: @color1; background-color: @color1;
padding: 2px 10px; padding: 2px 10px;
margin-top: 5px; margin-top: 5px;
@ -74,11 +74,10 @@ tooltip label {
color: @color7; color: @color7;
border: 1.2px solid @color7; border: 1.2px solid @color7;
} }
#custom-div{ #backlight{
background-color: @color1; border-radius: 4px;
margin-top: 3px; margin-right: 2px;
margin-bottom: 3px; margin-left: 4px;
} }
#clock { #clock {
padding-left: 15px; padding-left: 15px;
@ -90,13 +89,17 @@ tooltip label {
} }
#battery { #battery {
background-color: #ffffff; background-color: @color7;
color: black; color: black;
border: 1.2px solid @color7;
border-radius: 4px;
padding-top: 5px;
margin-left: 2px;
} }
#battery.charging { #battery.charging {
color: white; color: white;
background-color: #26A65B; background-color: @color1;
} }
@keyframes blink { @keyframes blink {