mirror of https://github.com/lcpz/lain.git
fix: better code
This commit is contained in:
parent
5a297dcfbb
commit
df19c9176e
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
Licensed under GNU General Public License v2
|
Licensed under GNU General Public License v2
|
||||||
* (c) 2013, yawnt <yawn.localhost@gmail.com>
|
* (c) 2013, yawnt <yawn.localhost@gmail.com>
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local newtimer = require("lain.helpers").newtimer
|
local newtimer = require("lain.helpers").newtimer
|
||||||
|
@ -14,7 +14,7 @@ local string = { match = string.match }
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
|
||||||
-- Brightness
|
-- Brightness
|
||||||
-- lain.widgets.contrib.brightness
|
-- lain.widgets.contrib.brightness
|
||||||
local brightness = {}
|
local brightness = {}
|
||||||
|
|
||||||
|
@ -28,12 +28,9 @@ local function worker(args)
|
||||||
|
|
||||||
function brightness.update()
|
function brightness.update()
|
||||||
local f = assert(io.popen('cat /sys/class/backlight/' .. backlight .. "/brightness"))
|
local f = assert(io.popen('cat /sys/class/backlight/' .. backlight .. "/brightness"))
|
||||||
|
brightness_now = f:read("*a")
|
||||||
brightness_now = {
|
|
||||||
level = f:read("*a")
|
|
||||||
}
|
|
||||||
f:close()
|
f:close()
|
||||||
|
|
||||||
widget = brightness.widget
|
widget = brightness.widget
|
||||||
settings()
|
settings()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue