Rewrote backlight manager
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
local backlight = {}
|
||||
|
||||
|
||||
backlight.hooks = {}
|
||||
backlight.add_hook = function(callback)
|
||||
backlight.hooks[#backlight.hooks + 1] = callback
|
||||
end
|
||||
|
||||
backlight.exec_hooks = function()
|
||||
backlight.read(function(status)
|
||||
for i=1, #backlight.hooks do
|
||||
backlight.hooks[i](status)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
backlight.read = function(callback)
|
||||
bin.backlight.get(
|
||||
function(stdout, stderr, exitreason, exitcode)
|
||||
callback(tonumber(stdout))
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
backlight.up = function()
|
||||
bin.backlight.up()
|
||||
backlight.exec_hooks()
|
||||
end
|
||||
|
||||
backlight.down = function()
|
||||
bin.backlight.down()
|
||||
backlight.exec_hooks()
|
||||
end
|
||||
|
||||
return backlight
|
@ -1,5 +1,4 @@
|
||||
return {
|
||||
backlight = require("wrapper.backlight"),
|
||||
sound = require("wrapper.sound"),
|
||||
ibus = require("wrapper.ibus"),
|
||||
--mdadm = require("wrapper.mdadm")
|
||||
|
Reference in New Issue
Block a user