Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local wibox = require("wibox")
- local awful = require("awful")
- batterywidget = wibox.widget.textbox()
- batterywidget:set_align("right")
- batterywidget:set_text(" | Battery | ")
- batterywidgettimer = timer({ timeout = 5 })
- batterywidgettimer:connect_signal("timeout",
- function()
- fh = assert(io.popen("acpi | cut -d, -f 2 -", "r"))
- batterywidget:set_text(" B: " .. fh:read("*l") .. " | ")
- fh:close()
- end
- )
- batterywidgettimer:start()
Advertisement
Add Comment
Please, Sign In to add comment