From 7ff798534a6fb9c99611d18ee22757346798ef61 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 23 Aug 2023 06:47:03 +0300 Subject: eww: Add an eww configuration --- .config/eww/scripts/battery | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 .config/eww/scripts/battery (limited to '.config/eww/scripts/battery') diff --git a/.config/eww/scripts/battery b/.config/eww/scripts/battery new file mode 100755 index 0000000..0db4adb --- /dev/null +++ b/.config/eww/scripts/battery @@ -0,0 +1,37 @@ +#!/bin/sh + +set -e + +acpi | awk ' + { + sub(/Battery [0-9]+: /, "") + FS = "[, ]+" + n = NF + sub(/%$/, "", $n) + printf "percentage=%d%%\n", $n + printf "icon=" + $n = int($n) + if ($1 == "Charging") + print "󰂄" + else if ($n >= 90) + print "󰁹" + else if ($n >= 80) + print "󰂂" + else if ($n >= 70) + print "󰂁" + else if ($n >= 60) + print "󰁿" + else if ($n >= 50) + print "󰁾" + else if ($n >= 40) + print "󰁽" + else if ($n >= 30) + print "󰁼" + else if ($n >= 20) + print "󰁻" + else if ($n >= 10) + print "󰁺" + else + print "󰂎" + }' \ + | jo -- cgit v1.2.3