Removed sound and mdadm wrappers
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
return {
|
||||
backlight = require("wrapper.backlight"),
|
||||
sound = require("wrapper.sound"),
|
||||
mdadm = require("wrapper.mdadm")
|
||||
backlight = require("wrapper.backlight")
|
||||
}
|
||||
|
@ -1,38 +0,0 @@
|
||||
local mdadm = {}
|
||||
|
||||
mdadm.get = function(callback)
|
||||
awful.spawn.easy_async("awk '/^md/ {printf \"%s: \", $1}; /blocks/ {print $NF}' /proc/mdstat",
|
||||
function(stdout, stderr, exitreason, exitcode)
|
||||
status = string.match(stdout, "%[(.*)%]")
|
||||
callback(status)
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
mdadm.indicator_text = wibox.widget.textbox("??")
|
||||
mdadm.indicator_text.valign = "center"
|
||||
mdadm.indicator_text.align = "center"
|
||||
mdadm.indicator_text.font = "Hack NF 10"
|
||||
|
||||
|
||||
mdadm.update_indicator = function(status)
|
||||
mdadm.indicator_text.markup = status
|
||||
end
|
||||
|
||||
-- Update the indicator
|
||||
mdadm.update_timer = gears.timer {
|
||||
timeout = 2,
|
||||
call_now = false,
|
||||
autostart = false, -- change to true to enable
|
||||
single_shot = false,
|
||||
|
||||
callback = function()
|
||||
mdadm.get(
|
||||
mdadm.update_indicator
|
||||
)
|
||||
end
|
||||
}
|
||||
|
||||
return mdadm
|
@ -1,22 +0,0 @@
|
||||
local sound = {}
|
||||
|
||||
sound.counter = 0
|
||||
|
||||
sound.play = function(sound_key)
|
||||
if (beautiful.sounds[sound_key] == nil) then
|
||||
naughty.notify({
|
||||
title = "Sound play error:",
|
||||
text = "There is no sound with key " .. sound_key
|
||||
})
|
||||
else
|
||||
if (sound.counter > 5) then
|
||||
return
|
||||
end
|
||||
sound.counter = sound.counter + 1
|
||||
awful.spawn.easy_async("play -q \"" .. beautiful.sounds[sound_key] .. "\"", function()
|
||||
sound.counter = sound.counter - 1
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
return sound
|
Reference in New Issue
Block a user