Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
fix icons don't update when consuming power
Browse files Browse the repository at this point in the history
  • Loading branch information
RMTT committed Sep 29, 2020
1 parent 64f359a commit ad3458d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions theme/fly/widget/battery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ local have_moved = false
local items = {}
local progressbars = {}

local show_percentage = false

function battery:init(config)
self.widget = wibox.widget {
image = icons.fly.battery_unknown,
Expand Down Expand Up @@ -56,10 +58,9 @@ function battery:init(config)
end)

awesome.connect_signal(sig.battery_manager.update_device, function(data)
local show_percentage = false
if data.type == constants.BATTERY_DEVICE_DISPLAY then
print("state: ", data.state)
if data.state then
show_percentage = false
if data.state == constants.BATTERY_DEVICE_STATE_UNKNOWN then
battery.widget:set_image(icons.fly.battery_unknown)
elseif data.state == constants.BATTERY_DEVICE_STATE_CHARGING then
Expand Down

0 comments on commit ad3458d

Please sign in to comment.