add warning when given theme does not exist
This commit is contained in:
parent
9045e67d18
commit
87ae97e5ef
|
@ -12,6 +12,7 @@ local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
|
local naughty = require("naughty")
|
||||||
|
|
||||||
local calendar_widget = {}
|
local calendar_widget = {}
|
||||||
|
|
||||||
|
@ -62,9 +63,18 @@ local function worker(args)
|
||||||
|
|
||||||
local args = args or {}
|
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 placement = args.placement or 'top'
|
||||||
|
|
||||||
|
|
||||||
local styles = {}
|
local styles = {}
|
||||||
local function rounded_shape(size)
|
local function rounded_shape(size)
|
||||||
return function(cr, width, height)
|
return function(cr, width, height)
|
||||||
|
|
Loading…
Reference in New Issue