Skip to content

Instantly share code, notes, and snippets.

@dry
Created March 5, 2014 23:12
Show Gist options
  • Save dry/9378757 to your computer and use it in GitHub Desktop.
Save dry/9378757 to your computer and use it in GitHub Desktop.
Awesome WM Simple Battery Widget
batterywidget = wibox.widget.textbox()
batterywidget:set_text(" | Battery | ")
batterywidgettimer = timer({ timeout = 5})
batterywidgettimer:connect_signal("timeout",
function()
fh = assert(io.popen("acpi | cut -d, -f 2,3 -", "r"))
batterywidget:set_text(" |" .. fh:read("*.l") .. " | ")
fh:close()
end
)
batterywidgettimer:start()
@jnishwanth
Copy link

Not sure why, but doesn't seem to work anymore. Is this method deprecated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment