summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2017-02-01 21:45:15 -0500
committerstreetturtle <streetturtle@gmail.com>2017-02-01 21:45:15 -0500
commitfa430134310cb6b3c98f445e423fa6095d800743 (patch)
treedd319e57b1a955cb3715ead7eda1eafc1e77969a /battery-widget
parente214e416d3ce53dec14e5f0e81ceae587f1fd4bc (diff)
readme update
Diffstat (limited to 'battery-widget')
-rw-r--r--battery-widget/README.md2
-rw-r--r--battery-widget/battery.lua6
2 files changed, 5 insertions, 3 deletions
diff --git a/battery-widget/README.md b/battery-widget/README.md
index b2c04ff..74298cd 100644
--- a/battery-widget/README.md
+++ b/battery-widget/README.md
@@ -7,6 +7,8 @@ This widget consists of
- a pop-up window, which shows up when you hover over an icon: ![Battery Widget](./bat-wid-2.png)
- a pop-up warning message which appears on bottom right corner when battery level is less that 15%: ![Battery Widget](./bat-wid-3.png)
+Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
+
## Installation
This widget reads the output of acpi tool.
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index c34c235..b2c78e7 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -9,7 +9,7 @@ battery_widget = wibox.widget { widget = wibox.widget.imagebox }
-- Battery 0: Discharging, 75%, 01:51:38 remaining
-- Battery 0: Charging, 53%, 00:57:43 until charged
-local path_to_icons = "/usr/share/icons/Arc-Icons/panel/22/"
+local path_to_icons = "/usr/share/icons/Arc/panel/22/"
watch(
"acpi", 10,
@@ -17,10 +17,10 @@ watch(
local batteryType
local _, status, charge, time = string.match(stdout, '(.+): (%a+), (%d%d)%%, (.+)')
charge = tonumber(charge)
- if (charge >= 0 and charge < 20) then
+ if (charge >= 0 and charge < 15) then
batteryType="battery-empty"
show_battery_warning()
- elseif (charge >= 20 and charge < 40) then batteryType="battery-caution"
+ elseif (charge >= 15 and charge < 40) then batteryType="battery-caution"
elseif (charge >= 40 and charge < 60) then batteryType="battery-low"
elseif (charge >= 60 and charge < 80) then batteryType="battery-good"
elseif (charge >= 80 and charge <= 100) then batteryType="battery-full"