moltenbar/mod/battery

18 lines
223 B
Plaintext
Raw Permalink Normal View History

2016-10-21 14:56:25 +00:00
# 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")