summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
authorpmakhov <pavel.makhov@savoirfairelinux.com>2017-10-05 10:14:02 -0400
committerpmakhov <pavel.makhov@savoirfairelinux.com>2017-10-05 10:14:02 -0400
commit57ccb09844f0a7d46077f4ecc686277ad1f8ca6f (patch)
tree9e81e76f08362d52d7660547dfd913c0c4fed6c4 /battery-widget
parent5a8f70f9e9f9d6b643cf301b9cc274fa909b5906 (diff)
improve code style
Diffstat (limited to 'battery-widget')
-rw-r--r--battery-widget/battery.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index 47955c9..3a8b1b9 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -7,8 +7,8 @@ local watch = require("awful.widget.watch")
-- 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/status/symbolic/"
-local username = os.getenv("USER")
+local PATH_TO_ICONS = "/usr/share/icons/Arc/status/symbolic/"
+local USERNAME = os.getenv("USER")
battery_widget = wibox.widget {
{
@@ -16,7 +16,7 @@ battery_widget = wibox.widget {
widget = wibox.widget.imagebox,
resize = false
},
- layout = wibox.container.margin(brightness_icon, 0, 0, 3),
+ layout = wibox.container.margin(_, 0, 0, 3),
set_image = function(self, path)
self.icon.image = path
end
@@ -41,7 +41,7 @@ watch(
else
batteryType = string.format(batteryType,'')
end
- widget.image = path_to_icons .. batteryType .. ".svg"
+ widget.image = PATH_TO_ICONS .. batteryType .. ".svg"
-- Update popup text
-- TODO: Filter long lines
@@ -80,7 +80,7 @@ battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notific
--[[ Show warning notification ]]
function show_battery_warning()
naughty.notify{
- icon = "/home/" .. username .. "/.config/awesome/nichosi.png",
+ icon = "/home/" .. USERNAME .. "/.config/awesome/nichosi.png",
icon_size=100,
text = "Huston, we have a problem",
title = "Battery is dying",