Skip to content

Commit

Permalink
Merge pull request #1 from Luka5W/revert-417-luka5w-calendar
Browse files Browse the repository at this point in the history
Revert "calendar-widget: added option to show week numbers, possible …
  • Loading branch information
Luka5W authored Nov 23, 2023
2 parents 14d74c5 + 2270b95 commit c2714b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 6 additions & 7 deletions calendar-widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.

### Customization

| Name | Default | Description |
|--------------|-----------|-------------------------------------|
| theme | `naughty` | The theme to use |
| placement | `top` | The position of the popup |
| radius | 8 | The popup radius |
| start_sunday | false | Start the week on Sunday |
| week_numbers | false | Show ISO week numbers (Mon = first) |
| Name | Default | Description |
|---|---|---|
| theme | `naughty` | The theme to use |
| placement | `top` | The position of the popup |
| radius | 8 | The popup radius |
| start_sunday | false | Start the week on Sunday |

- themes:

Expand Down
6 changes: 2 additions & 4 deletions calendar-widget/calendar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ local function worker(user_args)
local next_month_button = args.next_month_button or 4
local previous_month_button = args.previous_month_button or 5
local start_sunday = args.start_sunday or false
local week_numbers = args.week_numbers or false

local styles = {}
local function rounded_shape(size)
Expand Down Expand Up @@ -157,7 +156,7 @@ local function worker(user_args)
-- Change bg color for weekends
local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) }
local weekday = tonumber(os.date('%w', os.time(d)))
local default_bg = (flag == 'focus' or flag == 'normal') and (weekday == 0 or weekday == 6)
local default_bg = (weekday == 0 or weekday == 6)
and calendar_themes[theme].weekend_day_bg
or calendar_themes[theme].bg
local ret = wibox.widget {
Expand All @@ -174,7 +173,7 @@ local function worker(user_args)
shape_border_color = props.border_color or '#000000',
shape_border_width = props.border_width or 0,
fg = props.fg_color or calendar_themes[theme].fg,
bg = default_bg,
bg = props.bg_color or default_bg,
widget = wibox.container.background
}

Expand All @@ -187,7 +186,6 @@ local function worker(user_args)
fn_embed = decorate_cell,
long_weekdays = true,
start_sunday = start_sunday,
week_numbers = week_numbers,
widget = wibox.widget.calendar.month
}

Expand Down

0 comments on commit c2714b5

Please sign in to comment.