From 9cffa9b6eb594983b3f4fab4bceca42091a531e5 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 24 Sep 2023 10:07:04 -0400 Subject: add calendar widget to awesome --- programs/dotfiles/awesome/rc.lua | 98 ++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 39 deletions(-) (limited to 'programs/dotfiles/awesome/rc.lua') diff --git a/programs/dotfiles/awesome/rc.lua b/programs/dotfiles/awesome/rc.lua index ccd1d1a..065eda3 100644 --- a/programs/dotfiles/awesome/rc.lua +++ b/programs/dotfiles/awesome/rc.lua @@ -127,14 +127,23 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ -- {{{ Wibar -- Create a textclock widget -toptextclock = wibox.widget { - { - widget = wibox.widget.textclock - }, - bg = beautiful.bg_normal, - widget = wibox.container.background, - shape = gears.shape.rounded_rect -} +toptextclock = wibox.widget.textclock() +--toptextclock = wibox.widget { +-- { +-- widget = wibox.widget.textclock +-- }, +-- bg = beautiful.bg_normal, +-- widget = wibox.container.background, +-- shape = gears.shape.rounded_rect +--} + +local calendar_widget = require("calendar") +local topcalendar = calendar_widget() + +toptextclock:connect_signal("button::press", +function(_, _, _, button) + if button == 1 then topcalendar.toggle() end +end) -- Create a wibox for each screen and add it local taglist_buttons = gears.table.join( @@ -227,6 +236,8 @@ awful.screen.connect_for_each_screen(function(s) }, id = "shape_role", bg = beautiful.bg_normal, + shape_border_width = 2, + shape_border_color = beautiful.fg_minimize, shape = gears.shape.circle, widget = wibox.container.background, }, @@ -274,40 +285,31 @@ awful.screen.connect_for_each_screen(function(s) spacing = 4, layout = wibox.layout.flex.horizontal }, - widget_template = { + widget_template = + { + layout = wibox.layout.fixed.vertical, + { + wibox.widget.base.make_widget(), + id = 'background_role', + forced_height = 4, + widget = wibox.container.background + }, { - { - wibox.widget.base.make_widget(), - id = 'background_role', - forced_height = 4, - widget = wibox.container.background, - }, { { - { - { - id = 'icon_role', - widget = wibox.widget.imagebox, - }, - margins = 2, - widget = wibox.container.margin, - }, - { - id = 'text_role', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal + id = 'icon_role', + widget = wibox.widget.imagebox, }, - left = 4, - right = 4, - bottom = 4, + margins = 2, widget = wibox.container.margin, }, - layout = wibox.layout.fixed.vertical + { + id = 'text_role', + widget = wibox.widget.textbox + }, + layout = wibox.layout.fixed.horizontal }, - nil, - widget = wibox.container.background, - }, + } } -- Create the wibox @@ -327,10 +329,28 @@ awful.screen.connect_for_each_screen(function(s) }, s.mytasklist, -- Middle widget { -- Right widgets - layout = wibox.layout.fixed.horizontal, - wibox.container.margin(s.systray, 0, 0, 4, 4), - toptextclock, - s.mylayoutbox, + { + { + layout = wibox.layout.fixed.horizontal, + { + { + widget = s.systray, + }, + widget = wibox.container.margin, + left = 8, + top = 4, + bottom = 4 + }, + toptextclock, + wibox.container.margin(s.mylayoutbox, 4, 4, 4, 4), + }, + widget = wibox.container.background, + shape = gears.shape.rounded_rect, + shape_border_width = 1, + shape_border_color = beautiful.fg_minimize, + bg = beautiful.bg_normal, + }, + layout = wibox.layout.fixed.horizontal }, } end) -- cgit v1.2.1