improve code style
This commit is contained in:
parent
5a8f70f9e9
commit
57ccb09844
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue