summaryrefslogtreecommitdiff
path: root/calendar-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2019-12-17 21:37:24 -0500
committerstreetturtle <streetturtle@gmail.com>2019-12-17 21:37:24 -0500
commit87ae97e5ef7c930b42026342f99310e88b52f0f4 (patch)
tree81f16534731f1a81da30cd8cf842b656e81e7dde /calendar-widget
parent9045e67d18859c57033ed38e6b64b5ecaf6dedf0 (diff)
add warning when given theme does not exist
Diffstat (limited to 'calendar-widget')
-rw-r--r--calendar-widget/calendar.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua
index 1e4967e..8175a12 100644
--- a/calendar-widget/calendar.lua
+++ b/calendar-widget/calendar.lua
@@ -12,6 +12,7 @@ local awful = require("awful")
local beautiful = require("beautiful")
local wibox = require("wibox")
local gears = require("gears")
+local naughty = require("naughty")
local calendar_widget = {}
@@ -62,9 +63,18 @@ local function worker(args)
local args = args or {}
- local theme = args.theme or 'light'
+ if args.theme ~= nil and calendar_themes[args.theme] == nil then
+ naughty.notify({
+ preset = naughty.config.presets.critical,
+ title = 'Calendar Widget',
+ text = 'Theme "' .. args.theme .. '" not found, fallback to default'})
+ args.theme = 'nord'
+ end
+
+ local theme = args.theme or 'nord'
local placement = args.placement or 'top'
+
local styles = {}
local function rounded_shape(size)
return function(cr, width, height)