X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/72ed28967b4459a08c5c78f9a10d51b0174c20e6..edc6e0013eaeef22127f53a89b36d559ce7e7820:/widgets/contrib/tpbat/init.lua?ds=sidebyside diff --git a/widgets/contrib/tpbat/init.lua b/widgets/contrib/tpbat/init.lua index 72d6453..0a22526 100644 --- a/widgets/contrib/tpbat/init.lua +++ b/widgets/contrib/tpbat/init.lua @@ -75,7 +75,8 @@ function tpbat:show(t_out) tpbat_notification = naughty.notify({ preset = { fg = beautiful.fg_normal }, text = str, - timeout = t_out + timeout = t_out, + screen = client.focus and client.focus.screen or 1 }) end @@ -111,7 +112,8 @@ function tpbat.register(args) local n = naughty.notify({ preset = bat_notification_low_preset, title = "SMAPI Battery Warning: Unable to read battery state!", - text = "This widget is intended for ThinkPads. Is tp_smapi installed? Check your configs & paths." + text = "This widget is intended for ThinkPads. Is tp_smapi installed? Check your configs & paths.", + screen = client.focus and client.focus.screen or 1 }) end @@ -137,13 +139,15 @@ function tpbat.register(args) then tpbat.id = naughty.notify({ preset = bat_notification_critical_preset, - replaces_id = tpbat.id + replaces_id = tpbat.id, + screen = client.focus and client.focus.screen or 1 }).id elseif bat_now.perc <= 15 then tpbat.id = naughty.notify({ preset = bat_notification_low_preset, - replaces_id = tpbat.id + replaces_id = tpbat.id, + screen = client.focus and client.focus.screen or 1 }).id end end @@ -155,7 +159,7 @@ function tpbat.register(args) settings() end - newtimer("tpbat", timeout, update) + newtimer("tpbat-" .. bat.name, timeout, update) widget:connect_signal('mouse::enter', function () tpbat:show() end) widget:connect_signal('mouse::leave', function () tpbat:hide() end)