diff options
Diffstat (limited to 'rc.lua')
-rw-r--r-- | rc.lua | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -215,7 +215,18 @@ function act() awful.spawn.easy_async("bash -c \"acpi | cut -d',' -f2 \"", function(percent, stderr, reason, exit_code) a,b = string.find( percent, "%%") - mybatwidget:set_text ( "🔋" .. string.sub(percent, 1, a+1)) + nPercent = tonumber(string.sub(percent,2,a-1)) + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Niveau de batterie", + text = string.sub(percent,2,a-1) }) + if nPercent > 30 then + mybatwidget:set_markup_silently( markup("#19DF1D", "🔋") .. string.sub(percent, 1, a+1)) + elseif nPercent > 10 then + mybatwidget:set_markup_silently( markup("#E28126", "🔋") .. string.sub(percent, 1, a+1)) + else + mybatwidget:set_markup_silently( markup("#E61E1E", "🔋") .. string.sub(percent, 1, a+1)) + end -- str = awful.util.shell("acpi | cut -d',' -f2") if percent == " 21%\n" or percent == " 20%\n" then naughty.notify({ preset = naughty.config.presets.critical, |