Skip to content

Instantly share code, notes, and snippets.

@makefu
Created September 29, 2010 00:22
Show Gist options
  • Save makefu/602074 to your computer and use it in GitHub Desktop.
Save makefu/602074 to your computer and use it in GitHub Desktop.
mybattery = widget({ type="textbox"})
...
mywibox[s].widgets = {
...
mybattery,
...
}
mytimer = timer({ timeout = 30 })
-- i am sorry...
mytimer:add_signal("timeout", function () mybattery.text = io.popen("acpi | sed -e 's/Battery [0-9]: //' -e's/until charged//' -e 's/remaining//' -e's/ //g' -e 's/,/ /g'"):read() end)
mytimer:start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment