Created
March 5, 2014 23:12
-
-
Save dry/9378757 to your computer and use it in GitHub Desktop.
Awesome WM Simple Battery Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure why, but doesn't seem to work anymore. Is this method deprecated?