moltenbar/mod/battery

18 lines
223 B
Ruby

# vim: ft=ruby
class Battery < Worker
require 'open3'
def mainloop()
while true do
Open3.popen2("acpi") {|i,o,t|
self.write(o.gets.split[3])
}
sleep(10)
end
end
end
Modules.add("battery", "Battery")