local pairs = pairs
local string = string
local tconcat = table.concat
+local type = type
local tonumber = tonumber
local tostring = tostring
cal.notification = nil
end
- function cal.show(timeout, month, year, scr)
+ function cal.show(seconds, month, year, scr)
cal.notification_preset.text = tconcat(cal.build(month, year))
if cal.three then
preset = cal.notification_preset,
screen = cal.followtag and awful.screen.focused() or scr or 1,
icon = cal.icon,
- timeout = timeout or cal.notification_preset.timeout or 5
+ timeout = type(seconds) == "number" and seconds or cal.notification_preset.timeout or 5
}
end
local naughty = require("naughty")
local wibox = require("wibox")
local string = string
+local type = type
-- ThinkPad battery infos and widget creator
-- http://www.thinkwiki.org/wiki/Tp_smapi
tp_smapi.notification = naughty.notify {
title = string.format("%s: %s %s (%s)", batid, mfgr, model, chem),
text = msg,
- timeout = seconds or 0,
+ timeout = type(seconds) == "number" and seconds or 0,
screen = scr or focused()
}
end
local math = math
local string = string
local tconcat = table.concat
+local type = type
local tonumber = tonumber
local query_size = Gio.FILE_ATTRIBUTE_FILESYSTEM_SIZE
local query_free = Gio.FILE_ATTRIBUTE_FILESYSTEM_FREE
fs.notification_preset.screen = fs.followtag and focused() or scr or 1
fs.notification = naughty.notify {
preset = fs.notification_preset,
- timeout = seconds or 5
+ timeout = type(seconds) == "number" and seconds or 5
}
end
local math = math
local os = os
local string = string
+local type = type
local tonumber = tonumber
-- OpenWeatherMap
weather.icon_path = icons_path .. "na.png"
weather.icon = wibox.widget.imagebox(weather.icon_path)
- function weather.show(t_out)
+ function weather.show(seconds)
weather.hide()
if followtag then
weather.forecast_update()
end
- weather.notification = naughty.notify({
+ weather.notification = naughty.notify {
+ preset = notification_preset,
text = weather.notification_text,
icon = weather.icon_path,
- timeout = t_out,
- preset = notification_preset
- })
+ timeout = type(seconds == "number") and seconds or notification_preset.timeout
+ }
end
function weather.hide()
-Subproject commit 7a994596603c2129ae18dd2de69f765e2838c2cd
+Subproject commit 50fc0e4d153f67f105633b5bf1bda232155d5140