You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So my laptop has 2 batteries and the widget show battery 0 and 1 but when I'm trying to test the warning pop up 15% battery with the spaceman icon, it didn't work, in fact, it didn't even show any warning at all. Here is my batteryarc config
localawful=require("awful")
localbeautiful=require("beautiful")
localnaughty=require("naughty")
localwibox=require("wibox")
localwatch=require("awful.widget.watch")
localHOME=os.getenv("HOME")
localwidget= {}
localfunctionworker(args)
localargs=argsor {}
localfont=args.fontor'MonoSpace 6'localarc_thickness=args.arc_thicknessor2localshow_current_level=args.show_current_levelortruelocalsize=args.sizeor18localmain_color=args.main_colororbeautiful.fg_colorlocalbg_color=args.bg_coloror'#ffffff11'locallow_level_color=args.low_level_coloror'#e53935'localmedium_level_color=args.medium_level_coloror'#c0ca33'localcharging_color=args.charging_coloror'#43a047'localwarning_msg_title=args.warning_msg_titleor'Huston, we have a problem'localwarning_msg_text=args.warning_msg_textor'Battery is dying and its getting dark in here'localwarning_msg_position=args.warning_msg_positionor'top__right'localwarning_msg_icon=args.warning_msg_iconorHOME..'/.config/awesome/battery/spaceman.jpg'localenable_battery_warning=args.enable_battery_warningifenable_battery_warning==nilthenenable_battery_warning=trueendlocaltext=wibox.widget {
font=font,
align='center',
valign='center',
widget=wibox.widget.textbox
}
localtext_with_background=wibox.container.background(text)
widget=wibox.widget {
text_with_background,
max_value=100,
rounded_edge=true,
thickness=arc_thickness,
start_angle=4.71238898, -- 2pi*3/4forced_height=size,
forced_width=size,
bg=bg_color,
paddings=2,
widget=wibox.container.arcchart
}
locallast_battery_check=os.time()
localfunctionupdate_widget(widget, stdout)
localcharge=0localstatusforsinstdout:gmatch("[^\r\n]+") dolocalcur_status, charge_str, time=string.match(s, '.+: (%a+), (%d?%d?%d)%%,?(.*)')
ifcur_status~=nilandcharge_str~=nilthenlocalcur_charge=tonumber(charge_str)
ifcur_charge>chargethenstatus=cur_statuscharge=cur_chargeendendendwidget.value=chargeifstatus=='Charging' thentext_with_background.bg=charging_colortext_with_background.fg='#000000'elsetext_with_background.bg='#00000000'text_with_background.fg=main_colorendifshow_current_level==truethen--- if battery is fully charged (100) there is not enough place for three digits, so we don't show any texttext.text=charge==100and''orstring.format('%d', charge)
elsetext.text=''endifcharge<15thenwidget.colors= { low_level_color }
ifenable_battery_warningandstatus~='Charging' andos.difftime(os.time(), last_battery_check) >300then-- if 5 minutes have elapsed since the last warninglast_battery_check=os.time()
show_battery_warning()
endelseifcharge>15andcharge<40thenwidget.colors= { medium_level_color }
elsewidget.colors= { main_color }
endendwatch("acpi", 10, update_widget, widget)
-- Popup with battery infolocalnotificationfunctionshow_battery_status()
awful.spawn.easy_async([[bash -c 'acpi']],
function(stdout, _, _, _)
naughty.destroy(notification)
notification=naughty.notify {
text=stdout,
title="Battery status",
timeout=5,
hover_timeout=0.5,
width=200,
}
end)
endwidget:connect_signal("mouse::enter", function()
show_battery_status()
end)
widget:connect_signal("mouse::leave", function()
naughty.destroy(notification)
end)
--[[ Show warning notification ]]functionshow_battery_warning()
naughty.notify {
icon=warning_msg_icon,
icon_size=100,
text=warning_msg_text,
title=warning_msg_title,
timeout=25, -- show the warning for a longer timehover_timeout=0.5,
position=warning_msg_position,
bg="#F06060",
fg="#EEE9EF",
width=300,
}
endreturnwidgetendreturnsetmetatable(widget, { __call=function(_, ...)
returnworker(...)
end })
So my laptop has 2 batteries and the widget show battery 0 and 1 but when I'm trying to test the warning pop up 15% battery with the spaceman icon, it didn't work, in fact, it didn't even show any warning at all. Here is my batteryarc config
Here is my config at s.mytasklist in rc.lua
The text was updated successfully, but these errors were encountered: