From 4cced84d89e68a74af8294f3c1b4b093197132e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 6 Apr 2023 02:16:18 +0300 Subject: waybar: batter energy consumption/charge rate --- dotfiles/.config/waybar/config | 11 ++++++++++- dotfiles/.config/waybar/style.css | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index c807ba4..35f7c4d 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -19,6 +19,7 @@ "custom/mail-status", "custom/pac-status", "custom/news-status", + "custom/batwatt", "memory", "custom/torrent-status", "network", @@ -217,9 +218,17 @@ "interval": 180, "exec": "bards4battery" }, + "custom/batwatt": { + "format": " {}", + "interval": 10, + "exec-if": "test -e /sys/class/power_supply/BAT0", + "exec": "echo print\\(\\'{}W\\'.format\\($(grep 'POWER_SUPPLY_POWER_NOW' /sys/class/power_supply/BAT0/uevent | awk -F '=' '{print $2}')/1000000\\)\\) | python", + "exec-on-event": true, + "on-click": "" + }, "custom/swaykbd": { "format": "{}", "exec": "swaykbd", "tooltip": false - }, + } } diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css index 3d6a057..a7636b4 100644 --- a/dotfiles/.config/waybar/style.css +++ b/dotfiles/.config/waybar/style.css @@ -59,6 +59,7 @@ window#waybar { #custom-mail-status, #custom-news-status, #custom-waybar-mpris, +#custom-batwatt, #custom-torrent-status { color: #fdf6e3; padding: 0 6px; -- cgit v1.2.3