diff --git a/README.md b/README.md index 045abea..9654c5d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

-Set of super simple widgets compatible with Awesome Window Manager v.4+. +Set of widgets compatible with Awesome Window Manager v.4.3+. ## Screenshots diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua index b39b563..81c28a9 100644 --- a/calendar-widget/calendar.lua +++ b/calendar-widget/calendar.lua @@ -142,7 +142,7 @@ local function worker(user_args) -- highlight only today's day if flag == 'focus' then local today = os.date('*t') - if today.month ~= date.month then + if not (today.month == date.month and today.year == date.year) then flag = 'normal' end end diff --git a/github-contributions-widget/github-contributions-widget.lua b/github-contributions-widget/github-contributions-widget.lua index aecc966..113d474 100644 --- a/github-contributions-widget/github-contributions-widget.lua +++ b/github-contributions-widget/github-contributions-widget.lua @@ -11,9 +11,10 @@ local awful = require("awful") local naughty = require("naughty") local wibox = require("wibox") +local gears = require("gears") local widget_themes = require("awesome-wm-widgets.github-contributions-widget.themes") -local GET_CONTRIBUTIONS_CMD = [[bash -c "curl -s https://github-contributions.now.sh/api/v1/%s]] +local GET_CONTRIBUTIONS_CMD = [[bash -c "curl -s https://github-contributions.vercel.app/api/v1/%s]] .. [[ | jq -r '[.contributions[] ]] .. [[ | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].intensity'"]] @@ -35,7 +36,6 @@ end local function worker(user_args) local args = user_args or {} - local username = args.username or 'streetturtle' local days = args.days or 365 local color_of_empty_cells = args.color_of_empty_cells @@ -50,25 +50,17 @@ local function worker(user_args) if with_border == nil then with_border = true end - local function hex2rgb(hex) - if color_of_empty_cells ~= nil and hex == widget_themes[theme][0] then - hex = color_of_empty_cells - end - hex = tostring(hex):gsub('#','') - return tonumber('0x' .. hex:sub(1, 2)), - tonumber('0x' .. hex:sub(3, 4)), - tonumber('0x' .. hex:sub(5, 6)) - end - local function get_square(color) - local r, g, b = hex2rgb(color) + if color_of_empty_cells ~= nil and color == widget_themes[theme][0] then + color = color_of_empty_cells + end return wibox.widget{ fit = function() return 3, 3 end, draw = function(_, _, cr, _, _) - cr:set_source_rgb(r/255, g/255, b/255) + cr:set_source(gears.color(color)) cr:rectangle(0, 0, with_border and 2 or 3, with_border and 2 or 3) cr:fill() end, diff --git a/ram-widget/README.md b/ram-widget/README.md index dcbf9ab..6e80976 100644 --- a/ram-widget/README.md +++ b/ram-widget/README.md @@ -4,6 +4,8 @@ This widget shows the RAM usage. When clicked another widget appears with more d ![screenshot](./out.gif) +Note: this widget is compatible with Awesome v4.3+, as it is using [awful.popup](https://awesomewm.org/doc/api/classes/awful.popup.html) + ## Customization It is possible to customize widget by providing a table with all or some of the following config parameters: diff --git a/weather-widget/README.md b/weather-widget/README.md index 91593c8..3bf6228 100644 --- a/weather-widget/README.md +++ b/weather-widget/README.md @@ -8,7 +8,7 @@

-The widget showing current, hourly and daily weather forecast. +The widget showing current, hourly and daily weather forecast:

screenshot