Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets
This commit is contained in:
commit
44c370aa57
|
@ -13,7 +13,7 @@
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Set of super simple widgets compatible with Awesome Window Manager v.4+.
|
Set of widgets compatible with Awesome Window Manager v.4.3+.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ local function worker(user_args)
|
||||||
-- highlight only today's day
|
-- highlight only today's day
|
||||||
if flag == 'focus' then
|
if flag == 'focus' then
|
||||||
local today = os.date('*t')
|
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'
|
flag = 'normal'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,9 +11,10 @@
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
local gears = require("gears")
|
||||||
local widget_themes = require("awesome-wm-widgets.github-contributions-widget.themes")
|
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[] ]]
|
.. [[ | jq -r '[.contributions[] ]]
|
||||||
.. [[ | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].intensity'"]]
|
.. [[ | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].intensity'"]]
|
||||||
|
|
||||||
|
@ -35,7 +36,6 @@ end
|
||||||
local function worker(user_args)
|
local function worker(user_args)
|
||||||
|
|
||||||
local args = user_args or {}
|
local args = user_args or {}
|
||||||
|
|
||||||
local username = args.username or 'streetturtle'
|
local username = args.username or 'streetturtle'
|
||||||
local days = args.days or 365
|
local days = args.days or 365
|
||||||
local color_of_empty_cells = args.color_of_empty_cells
|
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
|
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 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{
|
return wibox.widget{
|
||||||
fit = function()
|
fit = function()
|
||||||
return 3, 3
|
return 3, 3
|
||||||
end,
|
end,
|
||||||
draw = function(_, _, cr, _, _)
|
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:rectangle(0, 0, with_border and 2 or 3, with_border and 2 or 3)
|
||||||
cr:fill()
|
cr:fill()
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -4,6 +4,8 @@ This widget shows the RAM usage. When clicked another widget appears with more d
|
||||||
|
|
||||||
![screenshot](./out.gif)
|
![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
|
## Customization
|
||||||
|
|
||||||
It is possible to customize widget by providing a table with all or some of the following config parameters:
|
It is possible to customize widget by providing a table with all or some of the following config parameters:
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
The widget showing current, hourly and daily weather forecast.
|
The widget showing current, hourly and daily weather forecast:
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://github.com/streetturtle/awesome-wm-widgets/raw/master/weather-widget/weather-widget.png" alt="screenshot" style="max-width:100%;">
|
<img src="https://github.com/streetturtle/awesome-wm-widgets/raw/master/weather-widget/weather-widget.png" alt="screenshot" style="max-width:100%;">
|
||||||
|
|
Loading…
Reference in New Issue