Merge pull request #448 from Ryuno-Ki/weather-migration

feat: migrate weather.lua to use WeatherAPI
This commit is contained in:
streetturtle 2024-07-06 17:33:12 -04:00 committed by GitHub
commit 09feeaaafd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 556 additions and 8 deletions

View File

@ -63,14 +63,6 @@ local apt_widget = wibox.widget({
end,
})
local apt_widget_button = wibox.widget({
{
apt_widget,
widget = wibox.container.margin,
},
widget = clickable_container, -- luacheck: ignore (todo fix)
})
--- Parses the line and creates the package table out of it
--- yaru-theme-sound/focal-updates,focal-updates 20.04.10.1 all [upgradable from: 20.04.8]
local parse_package = function(line)

View File

@ -0,0 +1,112 @@
# WeatherAPI widget
![Current Weather popup](./popup.png)
The widget consists of one section:
- current weather, including humidity, wind speed, UV index
## Customization
It is possible to customize widget by providing a table with all or some of the
following config parameters:
| Name | Default | Description |
|---|---|---|
| coordinates | Required | Table with two elements: latitude and longitude, e.g. `{46.204400, 6.143200}` |
| api_key | Required | [Follow the documentation](https://www.weatherapi.com/docs/) |
| font_name | `beautiful.font:gsub("%s%d+$", "")` | **Name** of the font to use e.g. 'Play' |
| units | `metric` | `metric` for celsius, `imperial` for fahrenheit |
| icon_pack_name | `weather-underground-icons` | Name of the icon pack, could be `weather-underground-icon` or `VitalyGorbachev` or create your own, more details below |
| icons_extension | `.png` | File extension of icons in the pack |
| timeout | 120 | How often in seconds the widget refreshes |
### Icons:
The widget comes with two predefined icon packs:
- [weather-underground-icons](https://github.com/manifestinteractive/weather-underground-icons)
- [VitalyGorbachev](https://www.flaticon.com/authors/vitaly-gorbachev)
To add your custom icons, create a folder with the pack name under `/icons` and
use the folder name in widget's config. There should be 18 icons, preferably
128x128 minimum. Icons should also respect the naming convention, please check
widget's source.
### Examples
#### Custom font, icons
```lua
weather_api_widget({
api_key='<your-key>',
coordinates = {45.5017, -73.5673},
units = 'imperial',
font_name = 'Carter One',
icons = 'VitalyGorbachev',
icons_extension = '.svg',
}),
```
#### Only current weather
```lua
weather_api_widget({
api_key='<your-key>',
coordinates = {45.5017, -73.5673},
}),
```
## Installation
1. Download json parser for lua from
[github.com/rxi/json.lua](https://github.com/rxi/json.lua) and place it
under **~/.config/awesome/**
(don't forget to star a repo <i class="fa fa-github-alt"></i> ):
```bash
wget -P ~/.config/awesome/ https://raw.githubusercontent.com/rxi/json.lua/master/json.lua
```
1. Clone this repo under **~/.config/awesome/**:
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. [Get Weather API key](https://www.weatherapi.com/docs/).
1. Require weather widget at the beginning of **rc.lua**:
```lua
local weather_api_widget = require("awesome-wm-widgets.weather-api-widget.weather")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
--default
weather_api_widget({
api_key='<your-key>',
coordinates = {45.5017, -73.5673},
}),
,
--customized
weather_api_widget({
api_key='<your-key>',
coordinates = {45.5017, -73.5673},
units = 'imperial',
font_name = 'Carter One',
icons = 'VitalyGorbachev',
icons_extension = '.svg',
}),
...
```
## How it works
The widget calls the API repeatedly in the specified intervals. The JSON
response is parsed and interpreted to build the popup.

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-36.313-10.61-63.24-44.243-63.24-84.46 0-48.586 39.399-88 88-88 43.692 0 79.442 31.706 86.66 72.6z" fill="#ffdf81"/><path d="m205.71 182.3c-35.032-27.064-84.728-23.74-115.93 7.48-31.241 31.222-34.517 80.933-7.48 115.93-21.095-16.244-34.3-41.635-34.3-69.71 0-48.586 39.399-88 88-88 28.054 0 53.457 13.194 69.71 34.3z" fill="#f9ecb4"/><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-18.921-5.528-35.498-17.355-46.99-33.51 9.31 7.96 20.29 13.99 32.33 17.51 9.61-17 27.84-28.46 48.76-28.46 0-36.59 27.31-66.82 62.66-71.4-2.31-13.08-7.51-25.16-14.91-35.56 15.486 13.209 26.014 31.411 29.57 51.56z" fill="#ffcd76"/><path d="m432 404h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><g fill="#d6ecff"><path d="m417.1 218.89c-46.079-37.029-114.104-28.239-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.917 50.224-46.78 86.78-15.2-10.01-25.22-27.22-25.22-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.325 165.18-3.9z"/><circle cx="144" cy="372" r="8"/><circle cx="132" cy="360" r="4"/></g><circle cx="88" cy="276" fill="#ffcd76" r="8"/><circle cx="76" cy="264" fill="#ffcd76" r="4"/><path d="m443.602 252.838c-25.196-86.926-138.057-109.482-194.836-39.078-6.722-1.433-13.209-1.932-19.768-1.689-3.59-14.029-10.297-26.969-19.701-38.055l28.361-28.36c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-28.359 28.357c-15.281-12.971-34.006-20.729-53.986-22.367v-32.333c0-4.419-3.581-8-8-8s-8 3.581-8 8v32.333c-19.981 1.638-38.707 9.397-53.986 22.367l-28.357-28.357c-3.124-3.124-8.189-3.124-11.313 0-3.125 3.124-3.125 8.189 0 11.313l28.356 28.358c-12.971 15.28-20.729 34.006-22.367 53.986h-32.333c-4.418 0-8 3.581-8 8s3.582 8 8 8h32.333c1.638 19.982 9.396 38.708 22.367 53.986l-28.357 28.357c-3.125 3.124-3.125 8.189 0 11.313 3.124 3.124 8.189 3.124 11.313 0l28.365-28.365c7.846 6.638 16.716 11.991 26.219 15.811-16.034 41.708 14.888 86.898 59.76 86.898h88c4.419 0 8-3.582 8-8s-3.581-8-8-8h-88c-26.467 0-48-21.533-48-48s21.533-48 48-48c4.419 0 8-3.582 8-8 0-35.29 28.71-64 64-64 35.786 0 64 29.266 64 64 0 4.418 3.582 8 8 8s8-3.582 8-8c0-31.505-18.765-59.95-46.817-72.79 52.83-57.606 147.007-31.003 164.288 42.804.798 3.41 3.721 5.904 7.214 6.156 33.26 2.397 59.315 30.435 59.315 63.83 0 35.29-28.71 64-64 64h-136c-4.418 0-8 3.582-8 8s3.582 8 8 8h136c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162zm-291.249 31.616c-18.303 2.189-34.246 12.143-44.461 26.453-53.943-20.263-69.902-90.047-28.453-131.472 43.546-43.571 117.258-23.281 133.571 34.845-32.607 7.968-57.443 35.974-60.657 70.174z"/><circle cx="272" cy="404" r="8"/></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><circle cx="255.999" cy="256" fill="#ffcd76" r="192"/><circle cx="255.999" cy="256" fill="#ffb562" r="152"/><path d="m256 80c4.418 0 8-3.581 8-8v-64c0-4.418-3.582-8-8-8s-8 3.582-8 8v64c0 4.419 3.582 8 8 8z"/><path d="m256 432c-4.418 0-8 3.582-8 8v64c0 4.418 3.582 8 8 8s8-3.582 8-8v-64c0-4.418-3.582-8-8-8z"/><path d="m504 248h-64.001c-4.418 0-8 3.581-8 8 0 4.418 3.582 8 8 8h64.001c4.418 0 8-3.582 8-8 0-4.419-3.582-8-8-8z"/><path d="m79.999 256c0-4.419-3.582-8-8-8h-63.999c-4.418 0-8 3.581-8 8 0 4.418 3.582 8 8 8h63.999c4.418 0 8-3.582 8-8z"/><path d="m122.342 133.657c3.125 3.125 8.189 3.124 11.314 0 3.124-3.124 3.124-8.189 0-11.313l-56-56c-3.125-3.124-8.189-3.124-11.314 0-3.124 3.124-3.124 8.189 0 11.313z"/><path d="m383.999 136c2.048 0 4.095-.781 5.657-2.343l56-56c3.124-3.124 3.124-8.189 0-11.313-3.125-3.124-8.189-3.124-11.314 0l-56 56c-5.056 5.055-1.405 13.656 5.657 13.656z"/><path d="m389.656 378.343c-3.125-3.124-8.189-3.124-11.314 0-3.124 3.124-3.124 8.189 0 11.313l56 56c1.563 1.562 3.609 2.343 5.657 2.343 7.061 0 10.714-8.6 5.657-13.657z"/><path d="m122.342 378.343-56 56c-3.124 3.124-3.124 8.189 0 11.313 3.125 3.125 8.189 3.124 11.314 0l56-56c3.124-3.124 3.124-8.189 0-11.313-3.125-3.124-8.189-3.124-11.314 0z"/><path d="m255.999 96c-88.225 0-160 71.776-160 160s71.775 160 160 160 160-71.776 160-160-71.775-160-160-160zm0 304c-79.402 0-144-64.598-144-144s64.598-144 144-144 144 64.598 144 144-64.598 144-144 144z"/><path d="m373.767 280.522c-4.252-1.182-8.666 1.307-9.851 5.563-13.416 48.23-57.793 81.915-107.916 81.915-61.757 0-112-50.243-112-112s50.243-112 112-112c50.314 0 94.736 33.847 108.024 82.309 1.167 4.26 5.564 6.765 9.83 5.6 4.261-1.169 6.768-5.57 5.6-9.831-15.187-55.392-65.954-94.078-123.454-94.078-70.579 0-128 57.42-128 128s57.421 128 128 128c57.281 0 107.996-38.5 123.33-93.626 1.185-4.257-1.307-8.668-5.563-9.852z"/><path d="m381.648 250.34c-3.086-3.108-8.188-3.121-11.31 0-3.114 3.114-3.117 8.203 0 11.32 3.128 3.128 8.229 3.103 11.31 0 3.129-3.128 3.13-8.19 0-11.32z"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-36.313-10.61-63.24-44.243-63.24-84.46 0-48.586 39.399-88 88-88 43.692 0 79.442 31.706 86.66 72.6z" fill="#ffdf81"/><path d="m205.71 182.3c-35.032-27.064-84.728-23.74-115.93 7.48-31.241 31.222-34.517 80.933-7.48 115.93-21.095-16.244-34.3-41.635-34.3-69.71 0-48.586 39.399-88 88-88 28.054 0 53.457 13.194 69.71 34.3z" fill="#f9ecb4"/><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-18.921-5.528-35.498-17.355-46.99-33.51 9.31 7.96 20.29 13.99 32.33 17.51 9.61-17 27.84-28.46 48.76-28.46 0-36.59 27.31-66.82 62.66-71.4-2.31-13.08-7.51-25.16-14.91-35.56 15.486 13.209 26.014 31.411 29.57 51.56z" fill="#ffcd76"/><path d="m432 404h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><g fill="#d6ecff"><path d="m417.1 218.89c-46.079-37.029-114.104-28.239-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.917 50.224-46.78 86.78-15.2-10.01-25.22-27.22-25.22-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.325 165.18-3.9z"/><circle cx="144" cy="372" r="8"/><circle cx="132" cy="360" r="4"/></g><circle cx="88" cy="276" fill="#ffcd76" r="8"/><circle cx="76" cy="264" fill="#ffcd76" r="4"/><path d="m443.602 252.838c-25.196-86.926-138.057-109.482-194.836-39.078-6.722-1.433-13.209-1.932-19.768-1.689-3.59-14.029-10.297-26.969-19.701-38.055l28.361-28.36c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-28.359 28.357c-15.281-12.971-34.006-20.729-53.986-22.367v-32.333c0-4.419-3.581-8-8-8s-8 3.581-8 8v32.333c-19.981 1.638-38.707 9.397-53.986 22.367l-28.357-28.357c-3.124-3.124-8.189-3.124-11.313 0-3.125 3.124-3.125 8.189 0 11.313l28.356 28.358c-12.971 15.28-20.729 34.006-22.367 53.986h-32.333c-4.418 0-8 3.581-8 8s3.582 8 8 8h32.333c1.638 19.982 9.396 38.708 22.367 53.986l-28.357 28.357c-3.125 3.124-3.125 8.189 0 11.313 3.124 3.124 8.189 3.124 11.313 0l28.365-28.365c7.846 6.638 16.716 11.991 26.219 15.811-16.034 41.708 14.888 86.898 59.76 86.898h88c4.419 0 8-3.582 8-8s-3.581-8-8-8h-88c-26.467 0-48-21.533-48-48s21.533-48 48-48c4.419 0 8-3.582 8-8 0-35.29 28.71-64 64-64 35.786 0 64 29.266 64 64 0 4.418 3.582 8 8 8s8-3.582 8-8c0-31.505-18.765-59.95-46.817-72.79 52.83-57.606 147.007-31.003 164.288 42.804.798 3.41 3.721 5.904 7.214 6.156 33.26 2.397 59.315 30.435 59.315 63.83 0 35.29-28.71 64-64 64h-136c-4.418 0-8 3.582-8 8s3.582 8 8 8h136c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162zm-291.249 31.616c-18.303 2.189-34.246 12.143-44.461 26.453-53.943-20.263-69.902-90.047-28.453-131.472 43.546-43.571 117.258-23.281 133.571 34.845-32.607 7.968-57.443 35.974-60.657 70.174z"/><circle cx="272" cy="404" r="8"/></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m214.9 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.39 12.26-49.71 30.21-40.11-8.19-70.29-43.68-70.29-86.21 0-48.6 39.4-88 88-88 43.85 0 80.21 32.08 86.9 74.05z" fill="#ffdf81"/><path d="m197.71 74.3c-57.029-44.085-141.71-3.868-141.71 69.7 0 20.21 6.82 38.84 18.29 53.7-20.86-16.08-34.29-41.33-34.29-69.7 0-48.6 39.4-88 88-88 28.38 0 53.63 13.44 69.71 34.3z" fill="#f9ecb4"/><g fill="#ffcd76"><path d="m214.9 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.391 12.26-49.71 30.21-21.04-4.3-39.351-16.11-52-32.51 10.399 8.04 22.649 13.79 36 16.51 9.319-17.95 28.08-30.21 49.71-30.21 0-33.87 23.391-62.28 54.9-69.95-2.36-14.81-8.41-28.38-17.19-39.75 17.37 13.39 29.59 33.14 33.19 55.75z"/><circle cx="88" cy="176" r="8"/><circle cx="76" cy="164" r="4"/></g><path d="m432 296h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><path d="m417.1 110.89c-46.079-37.029-114.104-28.239-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.916 50.225-46.779 86.78-15.201-10.01-25.221-27.22-25.221-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.325 165.18-3.9z" fill="#d6ecff"/><circle cx="144" cy="264" fill="#d6ecff" r="8"/><circle cx="132" cy="252" fill="#d6ecff" r="4"/><path d="m8 136h24.344c1.701 20.252 9.803 38.986 22.418 53.925l-20.419 20.419c-3.124 3.124-3.124 8.189 0 11.313 3.125 3.125 8.189 3.124 11.314 0l20.4-20.401c9.603 8.155 20.855 14.477 33.271 18.36-13.906 41.293 16.927 84.384 60.672 84.384h88c4.418 0 8-3.582 8-8s-3.582-8-8-8h-88c-26.468 0-48-21.533-48-48s21.532-48 48-48c4.418 0 8-3.581 8-8 0-35.29 28.71-64 64-64 35.786 0 64 29.266 64 64 0 4.419 3.582 8 8 8s8-3.581 8-8c0-31.505-18.765-59.95-46.817-72.79 52.832-57.61 147.007-31.001 164.288 42.804.798 3.41 3.721 5.904 7.214 6.156 33.26 2.397 59.315 30.435 59.315 63.83 0 35.29-28.71 64-64 64h-136c-4.418 0-8 3.582-8 8s3.582 8 8 8h136c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162-25.197-86.926-138.058-109.482-194.836-39.078-8.889-1.896-18.193-2.298-27.612-1.015-3.558-14.252-10.385-27.5-19.869-38.715l20.373-20.374c3.124-3.124 3.124-8.189 0-11.313-3.125-3.124-8.189-3.124-11.314 0l-20.364 20.365c-15.261-12.914-34.153-20.704-53.98-22.363v-24.345c0-4.418-3.582-8-8-8s-8 3.582-8 8v24.336c-20.469 1.697-39.133 9.843-53.955 22.396l-20.388-20.389c-3.124-3.124-8.188-3.125-11.314 0-3.124 3.124-3.124 8.189 0 11.313l20.389 20.389c-12.553 14.823-20.699 33.486-22.396 53.955h-24.336c-4.418 0-8 3.581-8 8s3.582 8 8 8zm120-88c37.101 0 68.781 25.398 77.6 60.485-28.902 10.134-50.281 36.411-53.247 67.969-19.198 2.296-35.8 13.133-45.918 28.581-34.171-9.541-58.435-41.071-58.435-77.035 0-44.112 35.888-80 80-80z"/><path d="m352 376c0-22.056-17.944-40-40-40s-40 17.944-40 40c0 4.418 3.582 8 8 8s8-3.582 8-8c0-13.233 10.767-24 24-24s24 10.767 24 24-10.767 24-24 24h-304c-4.418 0-8 3.582-8 8s3.582 8 8 8h304c22.056 0 40-17.944 40-40z"/><path d="m472 432h-304c-4.418 0-8 3.582-8 8s3.582 8 8 8h304c13.233 0 24 10.767 24 24s-10.767 24-24 24-24-10.767-24-24c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 22.056 17.944 40 40 40s40-17.944 40-40-17.944-40-40-40z"/><path d="m392 464h-288c-4.418 0-8 3.582-8 8s3.582 8 8 8h288c4.418 0 8-3.582 8-8s-3.582-8-8-8z"/><circle cx="72" cy="472" r="8"/><path d="m248 368h-176c-4.418 0-8 3.582-8 8s3.582 8 8 8h176c4.418 0 8-3.582 8-8s-3.582-8-8-8z"/><path d="m34.34 370.34c-3.114 3.114-3.117 8.203 0 11.32 3.113 3.113 8.201 3.119 11.32 0 3.121-3.122 3.109-8.209 0-11.32-3.116-3.115-8.203-3.116-11.32 0z"/><path d="m376 368c-4.418 0-8 3.582-8 8s3.582 8 8 8h64c4.418 0 8-3.582 8-8s-3.582-8-8-8z"/><path d="m466.34 370.34c-3.113 3.134-3.116 8.184 0 11.32 3.113 3.113 8.201 3.119 11.32 0 3.114-3.115 3.115-8.203 0-11.32-3.116-3.115-8.203-3.116-11.32 0z"/><path d="m266.34 290.34c-3.114 3.114-3.117 8.203 0 11.32 3.113 3.113 8.201 3.119 11.32 0 3.116-3.117 3.115-8.203 0-11.32-3.114-3.113-8.203-3.116-11.32 0z"/></svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512.132 512.132" height="512" viewBox="0 0 512.132 512.132" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m376.316 405.45c-5.93-1.391-11.67-3.3-17.17-5.66 27.36-24.98 42.82-59.16 32.92-95.62-6.21-22.88-24.96-58.47-46.62-94.96l10.67-20.53c22.92 39.41 54.75 96.32 59.95 115.49 8.751 32.226-.64 68.869-39.75 101.28z" fill="#5989b3"/><path d="m504.066 304.17c0 75.116-77.051 124.797-144.92 95.62 27.36-24.98 42.82-59.16 32.92-95.62-6.21-22.88-24.96-58.47-46.62-94.96l54.62-105.04z" fill="#99d0ff"/><path d="m376.316 405.45c-5.93-1.391-11.67-3.3-17.17-5.66 27.36-24.98 42.82-59.16 32.92-95.62-6.21-22.88-24.96-58.47-46.62-94.96l10.67-20.53c22.92 39.41 54.75 96.32 59.95 115.49 8.751 32.226-.64 68.869-39.75 101.28z" fill="#5989b3"/><path d="m152.986 399.79c-67.914 29.196-144.92-20.56-144.92-95.62l104-200 54.62 105.04c-21.66 36.49-40.41 72.08-46.62 94.96-9.9 36.46 5.56 70.64 32.92 95.62z" fill="#add9ff"/><path d="m137.196 405.45c5.93-1.391 11.67-3.3 17.17-5.66-27.36-24.98-42.82-59.16-32.92-95.62 6.21-22.88 24.96-58.47 46.62-94.96l-10.67-20.53c-22.92 39.41-54.75 96.32-59.95 115.49-8.751 32.226.64 68.869 39.75 101.28z" fill="#99d0ff"/><path d="m392.066 304.17c-17.615-64.882-136-232-136-232s-118.385 167.118-136 232c-19.68 72.487 60.889 136 136 136 75.11 0 155.68-63.513 136-136z" fill="#c2e3ff"/><path d="m266.566 439.76c-78.855 6.08-166.972-60.185-146.5-135.59 17.62-64.88 136-232 136-232s3.94 5.57 10.5 15.06c-29.36 42.53-111.11 163.9-125.51 216.94-18.77 69.12 53.62 130.08 125.51 135.59z" fill="#d6ecff"/><path d="m407.164 100.48c-2.977-5.726-11.206-5.75-14.195 0l-48.003 92.315c-37.236-61.366-79.457-121.136-82.371-125.248-3.177-4.486-9.861-4.514-13.056 0-2.914 4.112-45.135 63.882-82.372 125.248l-48.003-92.315c-2.977-5.726-11.206-5.75-14.195 0-111.226 213.912-104.903 200.775-104.903 203.69 0 77.983 78.302 132.392 151.33 104.879 62.282 53.104 149.942 50.643 209.34 0 72.953 27.486 151.33-26.829 151.33-104.879 0-2.888 6.316 10.208-104.902-203.69zm-391.079 205.609 95.981-184.578 45.456 87.416c-20.991 35.682-38.973 70.297-45.177 93.148-9.247 34.06 1.774 67.737 26.077 94.433-60.262 17.239-121.099-27.436-122.337-90.419zm239.981 126.081c-69.792 0-146.486-58.847-128.279-125.904 14.689-54.103 103.322-184.169 128.279-220.131 24.957 35.959 113.588 166.018 128.279 220.131 18.208 67.066-58.494 125.904-128.279 125.904zm117.644-35.663c24.391-26.788 35.294-60.483 26.077-94.433-6.204-22.851-24.185-57.466-45.177-93.146l45.456-87.417 95.981 184.578c-1.236 62.889-62.002 107.678-122.337 90.418z"/><path d="m286.976 164.139c-2.227-3.814-7.123-5.105-10.941-2.879-3.816 2.227-5.105 7.125-2.879 10.941l56 96c1.487 2.549 4.165 3.971 6.918 3.971 6.102 0 10.032-6.669 6.902-12.033z"/><path d="m357.726 290.51c-3.114-3.114-8.203-3.117-11.32 0-3.116 3.117-3.114 8.206 0 11.32 3.112 3.11 8.197 3.121 11.32 0 3.165-3.188 3.068-8.25 0-11.32z"/></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-36.313-10.61-63.24-44.243-63.24-84.46 0-48.586 39.399-88 88-88 43.692 0 79.442 31.706 86.66 72.6z" fill="#ffdf81"/><path d="m205.71 182.3c-35.032-27.064-84.728-23.74-115.93 7.48-31.241 31.222-34.517 80.933-7.48 115.93-21.095-16.244-34.3-41.635-34.3-69.71 0-48.586 39.399-88 88-88 28.054 0 53.457 13.194 69.71 34.3z" fill="#f9ecb4"/><path d="m222.66 220.6c-35.35 4.58-62.66 34.81-62.66 71.4-20.92 0-39.15 11.46-48.76 28.46-18.921-5.528-35.498-17.355-46.99-33.51 9.31 7.96 20.29 13.99 32.33 17.51 9.61-17 27.84-28.46 48.76-28.46 0-36.59 27.31-66.82 62.66-71.4-2.31-13.08-7.51-25.16-14.91-35.56 15.486 13.209 26.014 31.411 29.57 51.56z" fill="#ffcd76"/><path d="m432 404h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><g fill="#d6ecff"><path d="m417.1 218.89c-46.079-37.029-114.104-28.239-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.917 50.224-46.78 86.78-15.2-10.01-25.22-27.22-25.22-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.325 165.18-3.9z"/><circle cx="144" cy="372" r="8"/><circle cx="132" cy="360" r="4"/></g><circle cx="88" cy="276" fill="#ffcd76" r="8"/><circle cx="76" cy="264" fill="#ffcd76" r="4"/><path d="m443.602 252.838c-25.196-86.926-138.057-109.482-194.836-39.078-6.722-1.433-13.209-1.932-19.768-1.689-3.59-14.029-10.297-26.969-19.701-38.055l28.361-28.36c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-28.359 28.357c-15.281-12.971-34.006-20.729-53.986-22.367v-32.333c0-4.419-3.581-8-8-8s-8 3.581-8 8v32.333c-19.981 1.638-38.707 9.397-53.986 22.367l-28.357-28.357c-3.124-3.124-8.189-3.124-11.313 0-3.125 3.124-3.125 8.189 0 11.313l28.356 28.358c-12.971 15.28-20.729 34.006-22.367 53.986h-32.333c-4.418 0-8 3.581-8 8s3.582 8 8 8h32.333c1.638 19.982 9.396 38.708 22.367 53.986l-28.357 28.357c-3.125 3.124-3.125 8.189 0 11.313 3.124 3.124 8.189 3.124 11.313 0l28.365-28.365c7.846 6.638 16.716 11.991 26.219 15.811-16.034 41.708 14.888 86.898 59.76 86.898h88c4.419 0 8-3.582 8-8s-3.581-8-8-8h-88c-26.467 0-48-21.533-48-48s21.533-48 48-48c4.419 0 8-3.582 8-8 0-35.29 28.71-64 64-64 35.786 0 64 29.266 64 64 0 4.418 3.582 8 8 8s8-3.582 8-8c0-31.505-18.765-59.95-46.817-72.79 52.83-57.606 147.007-31.003 164.288 42.804.798 3.41 3.721 5.904 7.214 6.156 33.26 2.397 59.315 30.435 59.315 63.83 0 35.29-28.71 64-64 64h-136c-4.418 0-8 3.582-8 8s3.582 8 8 8h136c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162zm-291.249 31.616c-18.303 2.189-34.246 12.143-44.461 26.453-53.943-20.263-69.902-90.047-28.453-131.472 43.546-43.571 117.258-23.281 133.571 34.845-32.607 7.968-57.443 35.974-60.657 70.174z"/><circle cx="272" cy="404" r="8"/></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m424 352c0-30.928-25.072-56-56-56s-56 25.072-56 56c0-30.928-25.072-56-56-56s-56 25.072-56 56c0-30.928-25.072-56-56-56s-56 25.072-56 56v-16c0-101.62 66.38-184 168-184s168 82.38 168 184z" fill="#add9ff"/><path d="m424 336v16c0-30.93-25.07-56-56-56s-56 25.07-56 56c0-30.93-25.07-56-56-56s-56 25.07-56 56v-144c0-30.93 25.07-56 56-56 101.62 0 168 82.38 168 184z" fill="#5989b3"/><path d="m122.86 300.13c-20.45 8.34-34.86 28.42-34.86 51.87v-16c0-109.054 75.918-192.805 184-183.3-80.72 7.13-136.28 68.12-149.14 147.43z" fill="#d6ecff"/><path d="m312 208v144c0-30.93-25.07-56-56-56s-56 25.07-56 56v-144c0-30.93 25.07-56 56-56s56 25.07 56 56z" fill="#99d0ff"/><path d="m384.113 200.608c-66.53-75.616-189.628-75.694-256.227 0-30.879 35.096-47.886 83.179-47.886 135.392v16c0 4.418 3.582 8 8 8s8-3.582 8-8c0-26.467 21.532-48 48-48s48 21.533 48 48c0 4.418 3.582 8 8 8s8-3.582 8-8c0-23.741 17.328-43.5 40-47.32v55.32c0 4.418 3.582 8 8 8s8-3.582 8-8v-55.32c22.672 3.821 40 23.579 40 47.32 0 4.418 3.582 8 8 8s8-3.582 8-8c0-26.467 21.532-48 48-48s48 21.533 48 48c0 4.418 3.582 8 8 8s8-3.582 8-8v-16c0-52.213-17.007-100.296-47.887-135.392zm-286.288 107.12c8.546-65.202 47.475-120.975 108.765-140.359-9.111 11.059-14.59 25.217-14.59 40.631v101.724c-24.83-28.159-68.208-29.069-94.175-1.996zm110.175 1.996v-101.724c0-26.467 21.533-48 48-48s48 21.533 48 48v101.724c-25.565-28.992-70.481-28.939-96 0zm112 0v-101.724c0-15.414-5.478-29.572-14.59-40.632 61.337 19.399 100.221 75.171 108.765 140.359-25.986-27.092-69.364-26.14-94.175 1.997z"/><path d="m256 416c-4.418 0-8 3.582-8 8v48c0 13.234-10.767 24-24 24s-24-10.766-24-24c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 22.056 17.944 40 40 40s40-17.944 40-40v-48c0-4.418-3.582-8-8-8z"/><path d="m112 176c4.418 0 8-3.581 8-8v-160c0-4.418-3.582-8-8-8s-8 3.582-8 8v160c0 4.419 3.582 8 8 8z"/><path d="m400 176c4.418 0 8-3.581 8-8v-160c0-4.418-3.582-8-8-8s-8 3.582-8 8v160c0 4.419 3.582 8 8 8z"/><path d="m160 144c4.418 0 8-3.581 8-8v-96c0-4.418-3.582-8-8-8s-8 3.582-8 8v96c0 4.419 3.582 8 8 8z"/><path d="m352 144c4.418 0 8-3.581 8-8v-96c0-4.418-3.582-8-8-8s-8 3.582-8 8v96c0 4.419 3.582 8 8 8z"/><path d="m208 112c4.418 0 8-3.581 8-8v-96c0-4.418-3.582-8-8-8s-8 3.582-8 8v96c0 4.419 3.582 8 8 8z"/><path d="m256 96c4.418 0 8-3.581 8-8v-80c0-4.418-3.582-8-8-8s-8 3.582-8 8v80c0 4.419 3.582 8 8 8z"/><path d="m304 112c4.418 0 8-3.581 8-8v-96c0-4.418-3.582-8-8-8s-8 3.582-8 8v96c0 4.419 3.582 8 8 8z"/><circle cx="256" cy="120" r="8"/><circle cx="256" cy="392" r="8"/></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m214.9 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.39 12.26-49.71 30.21-40.11-8.19-70.29-43.68-70.29-86.21 0-48.6 39.4-88 88-88 43.85 0 80.21 32.08 86.9 74.05z" fill="#ffdf81"/><path d="m197.71 74.3c-57.028-44.086-141.71-3.868-141.71 69.7 0 20.21 6.82 38.84 18.29 53.7-20.86-16.08-34.29-41.33-34.29-69.7 0-48.6 39.4-88 88-88 28.38 0 53.63 13.44 69.71 34.3z" fill="#f9ecb4"/><g fill="#ffcd76"><path d="m214.9 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.39 12.26-49.71 30.21-21.04-4.3-39.35-16.11-52-32.51 10.4 8.04 22.65 13.79 36 16.51 9.32-17.95 28.08-30.21 49.71-30.21 0-33.87 23.39-62.28 54.9-69.95-2.36-14.81-8.41-28.38-17.19-39.75 17.37 13.39 29.59 33.14 33.19 55.75z"/><circle cx="88" cy="176" r="8"/><circle cx="76" cy="164" r="4"/></g><path d="m432 296h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><path d="m417.1 110.89c-46.079-37.029-114.104-28.239-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.917 50.224-46.78 86.78-15.2-10.01-25.22-27.22-25.22-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.325 165.18-3.9z" fill="#d6ecff"/><circle cx="144" cy="264" fill="#d6ecff" r="8"/><circle cx="132" cy="252" fill="#d6ecff" r="4"/><path d="m157.122 337.854c-3.396-2.828-8.439-2.37-11.268 1.024l-80 96c-4.362 5.236-.567 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m445.122 337.854c-3.396-2.828-8.438-2.37-11.268 1.024l-80 96c-4.362 5.235-.566 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m157.122 401.854c-3.396-2.829-8.439-2.371-11.268 1.024l-80 96c-4.362 5.236-.567 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m445.122 401.854c-3.396-2.829-8.438-2.371-11.268 1.024l-80 96c-4.362 5.235-.566 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m325.657 370.343c-3.124-3.124-8.189-3.124-11.313 0l-29.658 29.657h-20.686v-20.686l29.657-29.657c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-18.344 18.342v-12.686c0-4.418-3.582-8-8-8-4.419 0-8 3.582-8 8v12.686l-18.343-18.343c-3.124-3.124-8.189-3.124-11.313 0s-3.124 8.189 0 11.313l29.656 29.658v20.686h-20.687l-29.657-29.657c-3.124-3.124-8.189-3.124-11.313 0s-3.124 8.189 0 11.313l18.343 18.344h-12.686c-4.419 0-8 3.582-8 8s3.581 8 8 8h12.686l-18.343 18.343c-3.124 3.124-3.124 8.189 0 11.313s8.189 3.124 11.313 0l29.657-29.656h20.687v20.686l-29.657 29.657c-3.124 3.124-3.124 8.189 0 11.313s8.189 3.124 11.313 0l18.344-18.341v12.685c0 4.418 3.581 8 8 8 4.418 0 8-3.582 8-8v-12.685l18.343 18.342c3.124 3.124 8.189 3.124 11.313 0 3.125-3.124 3.125-8.189 0-11.313l-29.656-29.658v-20.686h20.686l29.657 29.657c1.562 1.562 3.609 2.343 5.657 2.343 7.063 0 10.711-8.603 5.657-13.657l-18.343-18.343h12.686c4.418 0 8-3.582 8-8s-3.582-8-8-8h-12.686l18.343-18.343c3.124-3.124 3.124-8.19 0-11.314z"/><path d="m443.602 144.838c-25.199-86.926-138.056-109.483-194.836-39.078-8.889-1.896-18.194-2.298-27.612-1.015-3.557-14.252-10.385-27.501-19.869-38.716l20.372-20.373c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-20.365 20.365c-15.26-12.914-34.152-20.704-53.979-22.363v-24.345c0-4.418-3.582-8-8-8-4.419 0-8 3.582-8 8v24.336c-20.469 1.697-39.133 9.843-53.955 22.396l-20.388-20.389c-3.124-3.124-8.189-3.124-11.313 0-3.125 3.124-3.125 8.189 0 11.313l20.388 20.388c-12.553 14.823-20.699 33.487-22.396 53.956h-24.336c-4.419 0-8 3.581-8 8s3.581 8 8 8h24.344c1.701 20.253 9.803 38.986 22.418 53.925l-20.418 20.419c-3.125 3.124-3.125 8.189 0 11.313 3.124 3.125 8.189 3.124 11.313 0l20.401-20.401c9.603 8.155 20.855 14.477 33.271 18.36-13.908 41.287 16.926 84.384 60.671 84.384h88c4.419 0 8-3.582 8-8s-3.581-8-8-8h-88c-26.467 0-48-21.533-48-48s21.533-48 48-48c4.418 0 8-3.581 8-8 0-35.29 28.71-64 64-64 35.786 0 64 29.266 64 64 0 4.419 3.582 8 8 8s8-3.581 8-8c0-31.505-18.765-59.95-46.817-72.79 52.764-57.536 146.995-31.065 164.288 42.804.798 3.41 3.722 5.904 7.214 6.156 33.26 2.397 59.315 30.435 59.315 63.83 0 35.29-28.71 64-64 64h-136c-4.418 0-8 3.582-8 8s3.582 8 8 8h136c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162zm-291.249 31.616c-19.198 2.296-35.8 13.133-45.918 28.581-34.172-9.541-58.435-41.071-58.435-77.035 0-68.375 80.706-104.958 132.165-60.651 12.567 10.821 21.438 25.237 25.434 41.137-28.902 10.133-50.28 36.412-53.246 67.968z"/><path d="m277.66 301.66c3.115-3.114 3.117-8.203 0-11.32-3.116-3.116-8.207-3.114-11.32 0-3.114 3.114-3.117 8.203 0 11.32 3.114 3.115 8.203 3.117 11.32 0z"/></svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" enable-background="new 0 0 512.012 512.012" height="512" viewBox="0 0 512.012 512.012" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m214.906 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.39 12.26-49.71 30.21-40.11-8.19-70.29-43.68-70.29-86.21 0-48.6 39.4-88 88-88 43.85 0 80.21 32.08 86.9 74.05z" fill="#ffdf81"/><path d="m197.716 74.3c-57.028-44.086-141.71-3.868-141.71 69.7 0 20.21 6.82 38.84 18.29 53.7-20.86-16.08-34.29-41.33-34.29-69.7 0-48.6 39.4-88 88-88 28.38 0 53.63 13.44 69.71 34.3z" fill="#f9ecb4"/><path d="m214.906 114.05c-31.51 7.67-54.9 36.08-54.9 69.95-21.63 0-40.39 12.26-49.71 30.21-21.04-4.3-39.35-16.11-52-32.51 10.4 8.04 22.65 13.79 36 16.51 9.32-17.95 28.08-30.21 49.71-30.21 0-33.87 23.39-62.28 54.9-69.95-2.36-14.81-8.41-28.38-17.19-39.75 17.37 13.39 29.59 33.14 33.19 55.75z" fill="#ffcd76"/><path d="m432.006 296h-272c-30.93 0-56-25.07-56-56s25.07-56 56-56c0-47.91 45.994-82.413 91.92-69.21 52.411-71.932 165.158-48.807 185.34 37.4 37.31 2.69 66.74 33.82 66.74 71.81 0 39.76-32.24 72-72 72z" fill="#add9ff"/><path d="m417.106 110.89c-46.084-37.033-114.11-28.233-149.18 19.9-46.024-13.231-91.92 21.386-91.92 69.21-45.061 0-70.917 50.224-46.78 86.78-15.2-10.01-25.22-27.22-25.22-46.78 0-30.93 25.07-56 56-56 0-47.91 45.994-82.413 91.92-69.21 40.366-55.401 122.233-57.324 165.18-3.9z" fill="#d6ecff"/><path d="m296.006 248-112 144h64l-48 112 128-144h-64z" fill="#ffdf81"/><path d="m443.608 144.838c-25.199-86.926-138.056-109.483-194.836-39.078-8.889-1.896-18.194-2.298-27.612-1.015-3.557-14.252-10.385-27.501-19.869-38.716l20.372-20.373c3.125-3.124 3.125-8.189 0-11.313-3.124-3.124-8.189-3.124-11.313 0l-20.365 20.365c-15.259-12.914-34.151-20.705-53.978-22.363v-24.345c0-4.418-3.582-8-8-8-4.419 0-8 3.582-8 8v24.336c-20.469 1.697-39.133 9.843-53.955 22.396l-20.389-20.389c-3.124-3.124-8.189-3.124-11.313 0-3.125 3.124-3.125 8.189 0 11.313l20.388 20.388c-12.553 14.823-20.699 33.487-22.396 53.956h-24.336c-4.419 0-8 3.581-8 8s3.581 8 8 8h24.344c1.701 20.253 9.803 38.986 22.418 53.925l-20.418 20.419c-3.125 3.124-3.125 8.189 0 11.313 3.124 3.125 8.189 3.124 11.313 0l20.401-20.401c9.603 8.155 20.855 14.477 33.271 18.36-13.908 41.287 16.926 84.384 60.671 84.384h82.31l-64.625 83.088c-4.081 5.247-.329 12.912 6.315 12.912h51.868l-43.221 100.849c-3.582 8.358 7.409 15.129 13.332 8.466l128-144c4.575-5.147.913-13.315-5.979-13.315h-53.394l13.714-48h143.68c44.112 0 80-35.888 80-80 0-39.794-29.603-73.503-68.398-79.162zm-395.602-16.838c0-68.375 80.706-104.958 132.165-60.651 12.567 10.821 21.438 25.237 25.434 41.137-28.902 10.134-50.28 36.412-53.246 67.969-19.198 2.296-35.8 13.133-45.918 28.581-34.172-9.542-58.435-41.072-58.435-77.036zm262.185 240-83.413 93.839 28.581-66.688c2.259-5.269-1.611-11.151-7.353-11.151h-47.643l76.607-98.495-20.656 72.297c-1.46 5.111 2.386 10.198 7.692 10.198zm121.815-80h-139.108l10.801-37.802c2.406-8.425-8.627-14.024-14.007-7.109l-34.932 44.911h-94.754c-26.467 0-48-21.533-48-48s21.533-48 48-48c4.418 0 8-3.581 8-8 0-35.29 28.71-64 64-64 35.776 0 64 29.257 64 64 0 4.419 3.581 8 8 8 4.418 0 8-3.581 8-8 0-31.505-18.765-59.95-46.817-72.79 52.766-57.537 146.993-31.076 164.288 42.804.798 3.41 3.722 5.904 7.214 6.156 33.261 2.398 59.315 30.436 59.315 63.831 0 35.289-28.71 63.999-64 63.999z"/><path d="m157.128 321.854c-3.396-2.829-8.438-2.37-11.268 1.024l-80 96c-4.369 5.244-.553 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m445.128 321.854c-3.395-2.829-8.438-2.37-11.268 1.024l-80 96c-4.369 5.244-.553 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m157.128 385.854c-3.396-2.828-8.438-2.37-11.268 1.024l-80 96c-4.369 5.244-.553 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><path d="m445.128 385.854c-3.395-2.828-8.438-2.37-11.268 1.024l-80 96c-4.369 5.244-.553 13.122 6.142 13.122 2.292 0 4.568-.98 6.15-2.878l80-96c2.828-3.395 2.37-8.439-1.024-11.268z"/><circle cx="144.006" cy="264" fill="#d6ecff" r="8"/><circle cx="132.006" cy="252" fill="#d6ecff" r="4"/><g fill="#ffcd76"><circle cx="76.006" cy="164" r="4"/><circle cx="88.006" cy="176" r="8"/></g></svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,13 @@
local de = {
warning_title = "Wetter Widget",
parameter_warning = "Folgende benötigte Parameter fehlen: ",
directions = {
"N", "NNO", "NO", "ONO", "O", "OSO", "SO", "SSO", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N"
},
feels_like = "Gefühlt: ",
wind = "Wind: ",
humidity = "Luftfeuchtigkeit: ",
uv = "UV-Index: "
}
return de

View File

@ -0,0 +1,14 @@
local en = {
warning_title = "Weather Widget",
parameter_warning = "Required parameters are not set: ",
directions = {
"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW",
"WSW", "W", "WNW", "NW", "NNW", "N"
},
feels_like = "Feels like ",
wind = "Wind: ",
humidity = "Humidity: ",
uv = "UV: "
}
return en

View File

@ -0,0 +1,14 @@
local fr = {
warning_title = "Widget Météo",
parameter_warning = "Les paramètres suivants sont obligatoires : ",
directions = {
"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSO", "SO",
"OSO", "O", "ONO", "NO", "NNO", "N"
},
feels_like = "ressentie à ",
wind = "Vent : ",
humidity = "Humidité : ",
uv = "Indice UV : "
}
return fr

View File

@ -0,0 +1,14 @@
local pt = {
warning_title = "Widget do tempo",
parameter_warning = "Parâmetros necessários não definidos: ",
directions = {
"N", "NNE", "NE", "ENE", "L", "ESE", "SE", "SSE", "S", "SSO", "SO",
"OSO", "O", "ONO", "NO", "NNO", "N"
},
feels_like = "Sensação de ",
wind = "Vento: ",
humidity = "Umidade: ",
uv = "UV: "
}
return pt

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,380 @@
-------------------------------------------------
-- Weather Widget based on the WeatherAPI
-- https://weatherapi.com/
--
-- @author Pavel Makhov
-- @copyright 2020 Pavel Makhov
-- @copyright 2024 André Jaenisch
-------------------------------------------------
local awful = require("awful")
local watch = require("awful.widget.watch")
local json = require("json")
local naughty = require("naughty")
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
local HOME_DIR = os.getenv("HOME")
local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/weather-widget'
local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]]
local SYS_LANG = os.getenv("LANG"):sub(1, 2)
if SYS_LANG == "C" or SYS_LANG == "C." then
-- C-locale is a common fallback for simple English
SYS_LANG = "en"
end
-- default language is ENglish
local LANG = gears.filesystem.file_readable(WIDGET_DIR .. "/" .. "locale/" ..
SYS_LANG .. ".lua") and SYS_LANG or "en"
local LCLE = require("awesome-wm-widgets.weather-widget.locale." .. LANG)
-- WeatherAPI supports only these according to https://www.weatherapi.com/docs/
-- ar, bn, bg, zh, zh_tw, cs, da, nl, fi, fr, de, el, hi, hu, it, ja, jv, ko,
-- zh_cmn, mr, pl, pt, pa, ro, ru, sr, si, sk, es, sv, ta, te, tr, uk, ur, vi,
-- zh_wuu, zh_hsn, zh_yue, zu
local function show_warning(message)
naughty.notify {
preset = naughty.config.presets.critical,
title = LCLE.warning_title,
text = message
}
end
if SYS_LANG ~= LANG then
show_warning("Your language is not supported yet. Language set to English")
end
local weather_widget = {}
local warning_shown = false
local tooltip = awful.tooltip {
mode = 'outside',
preferred_positions = {'bottom'}
}
local weather_popup = awful.popup {
ontop = true,
visible = false,
shape = gears.shape.rounded_rect,
border_width = 1,
border_color = beautiful.bg_focus,
maximum_width = 400,
offset = {y = 5},
hide_on_right_click = true,
widget = {}
}
--- Maps WeatherAPI condition code to file name w/o extension
--- See https://www.weatherapi.com/docs/#weather-icons
local icon_map = {
[1000] = "clear-sky",
[1003] = "few-clouds",
[1006] = "scattered-clouds",
[1009] = "scattered-clouds",
[1030] = "mist",
[1063] = "rain",
[1066] = "snow",
[1069] = "rain",
[1072] = "snow",
[1087] = "thunderstorm",
[1114] = "snow",
[1117] = "snow",
[1135] = "mist",
[1147] = "mist",
[1150] = "snow",
[1153] = "snow",
[1168] = "snow",
[1171] = "snow",
[1180] = "rain",
[1183] = "rain",
[1186] = "rain",
[1189] = "rain",
[1192] = "rain",
[1195] = "rain",
[1198] = "rain",
[1201] = "rain",
[1204] = "snow",
[1207] = "snow",
[1210] = "snow",
[1213] = "snow",
[1216] = "snow",
[1219] = "snow",
[1222] = "snow",
[1225] = "snow",
[1237] = "snow",
[1240] = "rain",
[1243] = "rain",
[1246] = "rain",
[1249] = "snow",
[1252] = "snow",
[1255] = "snow",
[1258] = "snow",
[1261] = "snow",
[1264] = "snow",
[1273] = "thunderstorm",
[1276] = "thunderstorm",
[1279] = "thunderstorm",
[1282] = "thunderstorm"
}
--- Convert degrees Celsius to Fahrenheit
local function celsius_to_fahrenheit(c) return c * 9 / 5 + 32 end
-- Convert degrees Fahrenheit to Celsius
local function fahrenheit_to_celsius(f) return (f - 32) * 5 / 9 end
local function gen_temperature_str(temp, fmt_str, show_other_units, units)
local temp_str = string.format(fmt_str, temp)
local s = temp_str .. '°' .. (units == 'metric' and 'C' or 'F')
if (show_other_units) then
local temp_conv, units_conv
if (units == 'metric') then
temp_conv = celsius_to_fahrenheit(temp)
units_conv = 'F'
else
temp_conv = fahrenheit_to_celsius(temp)
units_conv = 'C'
end
local temp_conv_str = string.format(fmt_str, temp_conv)
s = s .. ' ' .. '(' .. temp_conv_str .. '°' .. units_conv .. ')'
end
return s
end
local function uvi_index_color(uvi)
local color
if uvi >= 0 and uvi < 3 then color = '#a3be8c'
elseif uvi >= 3 and uvi < 6 then color = '#ebcb8b'
elseif uvi >= 6 and uvi < 8 then color = '#d08770'
elseif uvi >= 8 and uvi < 11 then color = '#bf616a'
elseif uvi >= 11 then color = '#b48ead'
end
return '<span weight="bold" foreground="' .. color .. '">' .. uvi .. '</span>'
end
local function worker(user_args)
local args = user_args or {}
--- Validate required parameters
if args.coordinates == nil or args.api_key == nil then
show_warning(LCLE.parameter_warning ..
(args.coordinates == nil and '<b>coordinates</b>' or '') ..
(args.api_key == nil and ', <b>api_key</b> ' or ''))
return
end
local coordinates = args.coordinates
local api_key = args.api_key
local font_name = args.font_name or beautiful.font:gsub("%s%d+$", "")
local units = args.units or 'metric'
local both_units_widget = args.both_units_widget or false
local icon_pack_name = args.icons or 'weather-underground-icons'
local icons_extension = args.icons_extension or '.png'
local timeout = args.timeout or 120
local ICONS_DIR = WIDGET_DIR .. '/icons/' .. icon_pack_name .. '/'
local weather_api =
('https://api.weatherapi.com/v1/current.json' ..
'?q=' .. coordinates[1] .. ',' .. coordinates[2] .. '&key=' .. api_key ..
'&units=' .. units .. '&lang=' .. LANG)
weather_widget = wibox.widget {
{
{
{
{
id = 'icon',
resize = true,
widget = wibox.widget.imagebox
},
valign = 'center',
widget = wibox.container.place,
},
{
id = 'txt',
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.horizontal,
},
left = 4,
right = 4,
layout = wibox.container.margin
},
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 4)
end,
widget = wibox.container.background,
set_image = function(self, path)
self:get_children_by_id('icon')[1].image = path
end,
set_text = function(self, text)
self:get_children_by_id('txt')[1].text = text
end,
is_ok = function(self, is_ok)
if is_ok then
self:get_children_by_id('icon')[1]:set_opacity(1)
self:get_children_by_id('icon')[1]:emit_signal('widget:redraw_needed')
else
self:get_children_by_id('icon')[1]:set_opacity(0.2)
self:get_children_by_id('icon')[1]:emit_signal('widget:redraw_needed')
end
end
}
local current_weather_widget = wibox.widget {
{
{
{
id = 'icon',
resize = true,
forced_width = 128,
forced_height = 128,
widget = wibox.widget.imagebox
},
align = 'center',
widget = wibox.container.place
},
{
id = 'description',
font = font_name .. ' 10',
align = 'center',
widget = wibox.widget.textbox
},
forced_width = 128,
layout = wibox.layout.align.vertical
},
{
{
{
id = 'temp',
font = font_name .. ' 36',
widget = wibox.widget.textbox
},
{
id = 'feels_like_temp',
align = 'center',
font = font_name .. ' 9',
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.vertical
},
{
{
id = 'wind',
font = font_name .. ' 9',
widget = wibox.widget.textbox
},
{
id = 'humidity',
font = font_name .. ' 9',
widget = wibox.widget.textbox
},
{
id = 'uv',
font = font_name .. ' 9',
widget = wibox.widget.textbox
},
expand = 'inside',
layout = wibox.layout.align.vertical
},
spacing = 16,
forced_width = 150,
layout = wibox.layout.fixed.vertical
},
forced_width = 300,
layout = wibox.layout.flex.horizontal,
update = function(self, weather)
self:get_children_by_id('icon')[1]:set_image(
ICONS_DIR .. icon_map[weather.condition.code] .. icons_extension)
self:get_children_by_id('temp')[1]:set_text(gen_temperature_str(weather.temp_c, '%.0f', false, units))
self:get_children_by_id('feels_like_temp')[1]:set_text(
LCLE.feels_like .. gen_temperature_str(weather.feelslike_c, '%.0f', false, units))
self:get_children_by_id('description')[1]:set_text(weather.condition.text)
self:get_children_by_id('wind')[1]:set_markup(
LCLE.wind .. '<b>' .. weather.wind_kph .. 'km/h (' .. weather.wind_dir .. ')</b>')
self:get_children_by_id('humidity')[1]:set_markup(LCLE.humidity .. '<b>' .. weather.humidity .. '%</b>')
self:get_children_by_id('uv')[1]:set_markup(LCLE.uv .. uvi_index_color(weather.uv))
end
}
local function update_widget(widget, stdout, stderr)
if stderr ~= '' then
if not warning_shown then
if (stderr ~= 'curl: (52) Empty reply from server'
and stderr ~= 'curl: (28) Failed to connect to api.weatherapi.com port 443: Connection timed out'
and stderr:find('^curl: %(18%) transfer closed with %d+ bytes remaining to read$') ~= nil
) then
show_warning(stderr)
end
warning_shown = true
widget:is_ok(false)
tooltip:add_to_object(widget)
widget:connect_signal('mouse::enter', function() tooltip.text = stderr end)
end
return
end
if string.match(stdout, '<') ~= nil then
if not warning_shown then
warning_shown = true
widget:is_ok(false)
tooltip:add_to_object(widget)
widget:connect_signal('mouse::enter', function() tooltip.text = stdout end)
end
return
end
warning_shown = false
tooltip:remove_from_object(widget)
widget:is_ok(true)
local result = json.decode(stdout)
widget:set_image(ICONS_DIR .. icon_map[result.current.condition.code] .. icons_extension)
-- TODO: if units isn't "metric", read temp_f instead
widget:set_text(gen_temperature_str(result.current.temp_c, '%.0f', both_units_widget, units))
current_weather_widget:update(result.current)
local final_widget = {
current_weather_widget,
spacing = 16,
layout = wibox.layout.fixed.vertical
}
weather_popup:setup({
{
final_widget,
margins = 10,
widget = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
})
end
weather_widget:buttons(gears.table.join(awful.button({}, 1, function()
if weather_popup.visible then
weather_widget:set_bg('#00000000')
weather_popup.visible = not weather_popup.visible
else
weather_widget:set_bg(beautiful.bg_focus)
weather_popup:move_next_to(mouse.current_widget_geometry)
end
end)))
watch(
string.format(GET_FORECAST_CMD, weather_api),
timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good
update_widget, weather_widget
)
return weather_widget
end
return setmetatable(weather_widget, {__call = function(_, ...) return worker(...) end})