From 4c954840680f72007054050493551b2c222a10f1 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Thu, 17 Jul 2025 12:27:47 +0100 Subject: Update yambar battery module to use more icons and script --- dot-config/yambar/config.yml | 61 ++++++++++++++++++++++-------------- dot-config/yambar/scripts/notify-bat | 3 ++ 2 files changed, 41 insertions(+), 23 deletions(-) create mode 100755 dot-config/yambar/scripts/notify-bat (limited to 'dot-config') diff --git a/dot-config/yambar/config.yml b/dot-config/yambar/config.yml index d4f96ac..91d1bfa 100755 --- a/dot-config/yambar/config.yml +++ b/dot-config/yambar/config.yml @@ -41,39 +41,54 @@ define: - &volume-down volume down 1% - &brightness-up brightnessctl set +1% - &brightness-down brightnessctl --min-value=10 set 1-% + + # Scripts - &pacman-notify ~/.config/yambar/scripts/pacman-notify - &pacman-update ~/.config/yambar/scripts/pacman-update - &newsboat-open ~/.config/yambar/scripts/newsboat-open + - ¬ify-bat ~/.config/yambar/scripts/notify-bat # MODULES battery: &battery name: BAT0 - poll-interval: 3000 + poll-interval: 5000 content: map: + on-click: *notify-bat + foreground: *teal + margin: *margin + default: {string: {text: "{state}"}} conditions: - ~(state == "unknown"): - map: - default: {string: {text: "{state}"}} - conditions: - state == "discharging": - - ramp: - tag: capacity - items: - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *RED} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *yellow} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *teal} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *teal} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *teal} - state == "charging": - - ramp: - tag: capacity - items: - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *RED} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *YLW} - - string: {text: "({estimate}) {capacity}% ", margin: *margin, foreground: *GRN} - state == "full": - - string: {text: "{capacity}% ", margin: *margin, foreground: *green} + state == "discharging": + - ramp: + tag: capacity + items: + - string: {text: "{capacity}% 󰁺", foreground: *RED} + - string: {text: "{capacity}% 󰁻", foreground: *orange} + - string: {text: "{capacity}% 󰁼", foreground: *yellow} + - string: {text: "{capacity}% 󰁽", foreground: *yellow} + - string: {text: "{capacity}% 󰁾"} + - string: {text: "{capacity}% 󰁿"} + - string: {text: "{capacity}% 󰂀"} + - string: {text: "{capacity}% 󰂁"} + - string: {text: "{capacity}% 󰂂"} + - string: {text: "{capacity}% 󰁹"} + state == "charging": + - ramp: + tag: capacity + items: + - string: {text: "({estimate}) {capacity}% 󰢜", foreground: *RED} + - string: {text: "({estimate}) {capacity}% 󰂆", foreground: *orange} + - string: {text: "({estimate}) {capacity}% 󰂇", foreground: *yellow} + - string: {text: "({estimate}) {capacity}% 󰂈", foreground: *yellow} + - string: {text: "({estimate}) {capacity}% 󰢝"} + - string: {text: "({estimate}) {capacity}% 󰂉"} + - string: {text: "({estimate}) {capacity}% 󰢞"} + - string: {text: "({estimate}) {capacity}% 󰂊"} + - string: {text: "({estimate}) {capacity}% 󰂋"} + - string: {text: "({estimate}) {capacity}% 󰂅"} + state == "full": + - string: {text: "{capacity}% 󰁹", foreground: *green} pipewire: &pipewire anchors: diff --git a/dot-config/yambar/scripts/notify-bat b/dot-config/yambar/scripts/notify-bat new file mode 100755 index 0000000..506e223 --- /dev/null +++ b/dot-config/yambar/scripts/notify-bat @@ -0,0 +1,3 @@ +#!/bin/sh + +notify-send "Battery" "Duration remaining: $(acpi | cut -d' ' -f5)" -- cgit