From a552cbd08cd7638e9feaa801aee06dc4bdaa7a31 Mon Sep 17 00:00:00 2001 From: lightly-toasted Date: Fri, 1 May 2026 00:33:28 +0900 Subject: [PATCH] feat(waybar): add battery indicator --- home/hosts/nixos.nix | 2 +- home/modules/graphical/waybar/default.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/home/hosts/nixos.nix b/home/hosts/nixos.nix index acdd6f6..f501652 100644 --- a/home/hosts/nixos.nix +++ b/home/hosts/nixos.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, ... }: +{ config, lib, inputs, ... }: { imports = [ inputs.nixvim.homeModules.nixvim diff --git a/home/modules/graphical/waybar/default.nix b/home/modules/graphical/waybar/default.nix index a30298e..3be3550 100644 --- a/home/modules/graphical/waybar/default.nix +++ b/home/modules/graphical/waybar/default.nix @@ -7,10 +7,11 @@ settings = [{ position = "top"; height = 5; - output = "HDMI-A-1"; + output = "!DP-1"; modules-left = [ "custom/mouse-actions" ]; modules-center = [ "privacy" ]; modules-right = [ + "battery" "pulseaudio" "network" "cpu" @@ -74,6 +75,15 @@ icon-size = 14; }; + battery = { + interval = 60; + format = "{capacity}% {icon}"; + format-icons = { + default = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + charge = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"]; + }; + }; + "custom/mouse-actions" = { format = " {}"; exec = "tail -n 1 -F ~/.config/mouse-actions/state 2>/dev/null";