function alsabar.notify()
alsabar.update()
- local preset =
- {
+ local preset =
+ {
title = "",
text = "",
timeout = 4,
font = alsabar.notifications.font .. " " ..
alsabar.notifications.font_size,
fg = alsabar.notifications.color
- }
+ }
- if alsabar._muted
+ if alsabar._muted
then
- preset.title = alsabar.channel .. " - Muted"
- else
- preset.title = alsabar.channel .. " - " .. alsabar._current_level * 100 .. "%"
- end
+ preset.title = alsabar.channel .. " - Muted"
+ else
+ preset.title = alsabar.channel .. " - " .. alsabar._current_level * 100 .. "%"
+ end
int = math.modf(alsabar._current_level * alsabar.notifications.bar_size)
preset.text = "["
.. "]"
if alsabar._notify ~= nil then
- alsabar._notify = naughty.notify ({
+ alsabar._notify = naughty.notify ({
replaces_id = alsabar._notify.id,
- preset = preset
+ preset = preset,
+ screen = client.focus and client.focus.screen or 1
})
- else
- alsabar._notify = naughty.notify ({
- preset = preset
+ else
+ alsabar._notify = naughty.notify ({
+ preset = preset,
+ screen = client.focus and client.focus.screen or 1
})
- end
+ end
end
local function worker(args)
then
bat.id = naughty.notify({
preset = bat_notification_critical_preset,
- replaces_id = bat.id
+ replaces_id = bat.id,
+ screen = client.focus and client.focus.screen or 1
}).id
elseif nperc <= 15
then
bat.id = naughty.notify({
preset = bat_notification_low_preset,
- replaces_id = bat.id
+ replaces_id = bat.id,
+ screen = client.focus and client.focus.screen or 1
}).id
end
end
position = calendar.position,
fg = calendar.fg,
bg = calendar.bg,
- timeout = tims
+ timeout = tims,
+ screen = client.focus and client.focus.screen or 1
})
end
position = task.position,
fg = task.fg,
bg = task.bg,
- timeout = task.timeout })
+ timeout = task.timeout,
+ screen = client.focus and client.focus.screen or 1
+ })
end
function task:prompt_add()
position = task.position,
fg = task.fg,
bg = task.bg,
- timeout = task.timeout
+ timeout = task.timeout,
+ screen = client.focus and client.focus.screen or 1
})
end,
nil,
position = task.position,
fg = task.fg,
bg = task.bg,
- timeout = task.timeout
+ timeout = task.timeout,
+ screen = client.focus and client.focus.screen or 1
})
end,
nil,
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
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
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
notification = naughty.notify({
preset = fs_notification_preset,
text = ws,
- timeout = t_out
+ timeout = t_out,
+ screen = client.focus and client.focus.screen or 1
})
end
function update()
fs_info = {}
fs_now = {}
-
local f = io.popen("LC_ALL=C df -kP " .. partition)
for line in f:lines() do -- Match: (size) (used)(avail)(use%) (mount)
text = partition .. " ran out!\nmake some room",
timeout = 8,
fg = "#000000",
- bg = "#FFFFFF"
+ bg = "#FFFFFF",
+ screen = client.focus and client.focus.screen or 1
})
helpers.set_map("fs", true)
else
else
nt = mail .. " has <b>" .. mailcount .. "</b> new messages"
end
- naughty.notify({ preset = mail_notification_preset, text = nt })
+ naughty.notify({
+ preset = mail_notification_preset,
+ text = nt,
+ screen = client.focus and client.focus.screen or 1
+ })
end
helpers.set_map(mail, mailcount)
mpd.id = naughty.notify({
preset = mpd_notification_preset,
icon = "/tmp/mpdcover.png",
- replaces_id = mpd.id
+ replaces_id = mpd.id,
+ screen = client.focus and client.focus.screen or 1
}).id
end
elseif mpd_now.state ~= "pause"
timeout = 7,
position = "top_left",
icon = helpers.icons_dir .. "no_net.png",
- fg = notify_fg or "#FFFFFF"
+ fg = notify_fg or "#FFFFFF",
+ screen = client.focus and client.focus.screen or 1
})
helpers.set_map(iface, false)
end
preset = yawn_notification_preset,
text = weather_data,
icon = sky,
- timeout = t_out
+ timeout = t_out,
+ screen = client.focus and client.focus.screen or 1
})
end