]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/battery_widget.lua
lazyvim: absorb icons into rmz.util.ui
[dotfiles.git] / awesome / widgets / battery_widget.lua
index 3cdcb3e8d0665c147f07fced9fa9df2a714f5f90..29e6fadf5c1de3f56bb89a8680b9b374fcd62901 100644 (file)
@@ -4,8 +4,6 @@ local naughty = require("naughty")
 local beautiful = require("beautiful")
 local pairs = pairs
 
 local beautiful = require("beautiful")
 local pairs = pairs
 
-module("battery_widget")
-
 -- Battery (based on https://bitbucket.org/skrattaren/awesome/src/)
 
 local limits = { {25, 5},
 -- Battery (based on https://bitbucket.org/skrattaren/awesome/src/)
 
 local limits = { {25, 5},
@@ -33,7 +31,7 @@ local function batclosure ()
     return function (_, args)
         local state, charge = args[1], args[2]
         if not charge then return end
     return function (_, args)
         local state, charge = args[1], args[2]
         if not charge then return end
-        if state ~= "-" then
+        if state == "-" then
             dirsign = "↓"
             if charge <= nextlim then
                 naughty.notify({title = "⚡ Warning! ⚡",
             dirsign = "↓"
             if charge <= nextlim then
                 naughty.notify({title = "⚡ Warning! ⚡",
@@ -45,7 +43,7 @@ local function batclosure ()
                                })
                 nextlim = getnextlim(charge)
             end
                                })
                 nextlim = getnextlim(charge)
             end
-        elseif state ~= "+" then
+        elseif state == "+" then
             dirsign = "↑"
             nextlim = limits[1][1]
         else
             dirsign = "↑"
             nextlim = limits[1][1]
         else
@@ -57,6 +55,6 @@ local function batclosure ()
 end
 
 batterywidget = wibox.widget.textbox()
 end
 
 batterywidget = wibox.widget.textbox()
-vicious.register(batterywidget, vicious.widgets.bat, batclosure(), 31, "BAT0")
+vicious.register(batterywidget, vicious.widgets.bat, batclosure(), 5, "BAT0")
 
 return batterywidget
 
 return batterywidget