feat(waybar): add battery indicator

This commit is contained in:
toast 2026-05-01 00:33:28 +09:00
parent 282f97f848
commit a552cbd08c
2 changed files with 12 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, ... }: { config, lib, inputs, ... }:
{ {
imports = [ imports = [
inputs.nixvim.homeModules.nixvim inputs.nixvim.homeModules.nixvim

View file

@ -7,10 +7,11 @@
settings = [{ settings = [{
position = "top"; position = "top";
height = 5; height = 5;
output = "HDMI-A-1"; output = "!DP-1";
modules-left = [ "custom/mouse-actions" ]; modules-left = [ "custom/mouse-actions" ];
modules-center = [ "privacy" ]; modules-center = [ "privacy" ];
modules-right = [ modules-right = [
"battery"
"pulseaudio" "pulseaudio"
"network" "network"
"cpu" "cpu"
@ -74,6 +75,15 @@
icon-size = 14; icon-size = 14;
}; };
battery = {
interval = 60;
format = "{capacity}% {icon}";
format-icons = {
default = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
charge = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"];
};
};
"custom/mouse-actions" = { "custom/mouse-actions" = {
format = " {}"; format = " {}";
exec = "tail -n 1 -F ~/.config/mouse-actions/state 2>/dev/null"; exec = "tail -n 1 -F ~/.config/mouse-actions/state 2>/dev/null";