[calendar] Add theme from local config

- add a theme called 'naughty'
- make colors and corner radius configurable
This commit is contained in:
Thomas Friese 2020-11-21 12:38:51 +01:00
parent 207ad20d72
commit 907a7c15fa
No known key found for this signature in database
GPG Key ID: 5F3F3F149FECADA6
2 changed files with 18 additions and 4 deletions

View File

@ -9,10 +9,11 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.
| Name | Screenshot |
|---|---|
|nord (default) | ![nord_theme](./nord.png) |
| nord (default) | ![nord_theme](./nord.png) |
| outrun | ![outrun_theme](./outrun.png) |
| light | ![outrun_theme](./light.png) |
| dark | ![outrun_theme](./dark.png) |
| naughty (default) | from local theme |
- setup widget placement
@ -45,6 +46,7 @@ local cw = calendar_widget()
local cw = calendar_widget({
theme = 'outrun',
placement = 'bottom_right'
radius = 8
})
mytextclock:connect_signal("button::press",
function(_, _, _, button)

View File

@ -68,7 +68,18 @@ local function worker(args)
weekday_fg = '#FD971F',
header_fg = '#F92672',
border = '#75715E'
},
naughty = {
bg = beautiful.notification_bg or beautiful.bg,
fg = beautiful.notification_fg or beautiful.fg,
focus_date_bg = beautiful.notification_fg or beautiful.fg,
focus_date_fg = beautiful.notification_bg or beautiful.bg,
weekend_day_bg = beautiful.bg_focus,
weekday_fg = beautiful.fg,
header_fg = beautiful.fg,
border = beautiful.border_normal
}
}
local args = args or {}
@ -78,11 +89,12 @@ local function worker(args)
preset = naughty.config.presets.critical,
title = 'Calendar Widget',
text = 'Theme "' .. args.theme .. '" not found, fallback to default'})
args.theme = 'nord'
args.theme = 'naughty'
end
local theme = args.theme or 'nord'
local theme = args.theme or 'naughty'
local placement = args.placement or 'top'
local radius = args.radius or 8
local styles = {}
@ -175,7 +187,7 @@ local function worker(args)
local popup = awful.popup {
ontop = true,
visible = false,
shape = gears.shape.rounded_rect,
shape = rounded_shape(radius),
offset = { y = 5 },
border_width = 1,
border_color = calendar_themes[theme].border,