Guest User

huehuehue

a guest
Sep 28th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local wibox = require("wibox")
  2. local awful = require("awful")
  3.  
  4. batterywidget = wibox.widget.textbox()
  5. batterywidget:set_align("right")    
  6. batterywidget:set_text(" | Battery | ")    
  7. batterywidgettimer = timer({ timeout = 5 })    
  8. batterywidgettimer:connect_signal("timeout",    
  9.   function()    
  10.     fh = assert(io.popen("acpi | cut -d, -f 2 -", "r"))
  11.     batterywidget:set_text(" B: " .. fh:read("*l") .. " | ")  
  12.     fh:close()    
  13.   end    
  14. )    
  15. batterywidgettimer:start()
Advertisement
Add Comment
Please, Sign In to add comment