[BREAKING] Initialize the widget when `require`d

This commit is contained in:
Stefano Mazzucco 2019-11-09 22:25:24 +00:00
parent bdb814d67c
commit 18f379f323
2 changed files with 3 additions and 3 deletions

View File

@ -95,10 +95,9 @@ Require the module:
-- require *after* `beautiful.init` or the theme will be inconsistent! -- require *after* `beautiful.init` or the theme will be inconsistent!
local power = require("power_widget") local power = require("power_widget")
-- override the GUI client. -- override the GUI client.
power.gui_client = "xfce4-power-manager" power.gui_client = "xfce4-power-manager-settings"
-- override the critical battery percentage -- override the critical battery percentage
power.critical_percentage = 18 power.critical_percentage = 18
power:init()
``` ```
Add the widget to your layout: Add the widget to your layout:

View File

@ -136,6 +136,7 @@ function widget:init()
end end
end end
))) )))
return self
end end
return widget return widget:init()