daily pastebin goal
25%
SHARE
TWEET

Vicious Battery Widget

liliff Apr 5th, 2012 850 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. batmon = awful.widget.progressbar()
  2. batmon:set_width(8)
  3. batmon:set_vertical(true)
  4. batmon:set_border_color("#3f3f3f")
  5. batmon:set_color("#5f5f5f")
  6. batmon_t = awful.tooltip({ objects = { batmon.widget },})
  7. vicious.register(batmon, vicious.widgets.bat, function (widget, args)
  8.                 batmon_t:set_text(" State: " .. args[1] .. " | Charge: " .. args[2] .. "% | Remaining: " .. args[3])
  9.                 if args[2] <= 5 then
  10.                         naughty.notify({ text="Battery is low! " .. args[2] .. " percent remaining." })
  11.                 end
  12.                 return args[2]
  13.                 end , 60, "BAT0")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top