update from master
This commit is contained in:
parent
6d5d675350
commit
399c97ddf6
|
@ -21,6 +21,30 @@ It is possible to customize widget by providing a table with all or some of the
|
|||
| `username` | your username | Required parameter |
|
||||
| `number_of_events` | 10 | Number of events to display in the list |
|
||||
|
||||
## Installation
|
||||
|
||||
Clone repo under **~/.config/awesome/** and add widget in **rc.lua**:
|
||||
|
||||
```lua
|
||||
local github_activity_widget = require("awesome-wm-widgets.github-activity-widget.github-activity-widget")
|
||||
...
|
||||
s.mytasklist, -- Middle widget
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
...
|
||||
-- default
|
||||
github_activity_widget{
|
||||
username = 'streetturtle',
|
||||
},
|
||||
-- customized
|
||||
github_activity_widget{
|
||||
username = 'streetturtle',
|
||||
number_of_events = 5
|
||||
},
|
||||
|
||||
```
|
||||
|
||||
|
||||
## How it works
|
||||
|
||||
Everything starts with this timer, which gets recent activities by calling GitHub [Events API](../awesome-wm-widgets/assets/img/screenshots/github-activity-widgetttps://developer.github.com/v3/activity/events/) and stores the response under /.cache/awmw/github-activity-widget/activity.json directory:
|
||||
|
|
|
@ -65,8 +65,8 @@ Paused:
|
|||
First you need to have spotify CLI installed, it uses dbus to communicate with spotify-client:
|
||||
|
||||
```bash
|
||||
git clone https://gist.github.com/wandernauta/6800547.git
|
||||
cd ./6800547
|
||||
git clone https://gist.github.com/fa6258f3ff7b17747ee3.git
|
||||
cd ./fa6258f3ff7b17747ee3
|
||||
chmod +x sp
|
||||
sudo cp ./sp /usr/local/bin/
|
||||
```
|
||||
|
|
|
@ -28,6 +28,7 @@ It is possible to customize widget by providing a table with all or some of the
|
|||
| `inc_volume_cmd` | `amixer -D pulse sset Master 5%+` | Increase volume level |
|
||||
| `dec_volume_cmd` | `amixer -D pulse sset Master 5%-` | Decrease volume level |
|
||||
| `tog_volume_cmd` | `amixer -D pulse sset Master toggle` | Mute / unmute |
|
||||
| `button_press` | `function(_, _, _, button) <sane default logic> end` | Overwrite the 'button\_press' signal for this widget |
|
||||
|
||||
### Example:
|
||||
|
||||
|
@ -36,7 +37,11 @@ volumearc_widget({
|
|||
main_color = '#af13f7',
|
||||
mute_color = '#ff0000',
|
||||
thickness = 5,
|
||||
height = 25
|
||||
height = 25,
|
||||
button_press = function(_, _, _, button) -- Overwrites the button press behaviour to open pavucontrol when clicked
|
||||
if (button == 1) then awful.spawn('pavucontrol --tab=3', false)
|
||||
end
|
||||
end
|
||||
})
|
||||
```
|
||||
|
||||
|
|
|
@ -3,9 +3,14 @@ layout: page
|
|||
---
|
||||
# Weather widget
|
||||
|
||||
![Weather Widget](../awesome-wm-widgets/assets/img/screenshots/weather-widget/weather-widget.png)
|
||||
<p align="center">
|
||||
<img src="https://github.com/streetturtle/awesome-wm-widgets/raw/master/weather-widget/screenshots/weather-widget.png" alt="screenshot" style="max-width:100%;">
|
||||
</p>
|
||||
|
||||
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
|
||||
Widget consists of three sections:
|
||||
- current weather, including humidity, wind speed, UV index
|
||||
- hourly forecast for the next 24 hours
|
||||
- daily forecast for the next five days
|
||||
|
||||
## Customization
|
||||
|
||||
|
@ -13,34 +18,63 @@ It is possible to customize widget by providing a table with all or some of the
|
|||
|
||||
| Name | Default | Description |
|
||||
|---|---|---|
|
||||
| `font` | `Play 9` | Font |
|
||||
| `city` | `Montreal,ca` | City name and country code, [more info](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://openweathermap.org/current) |
|
||||
| `api_key` | none| API key, required |
|
||||
| `units` | `metric` | `metric` for celsius, `imperial` for fahrenheit |
|
||||
| `both_units_widget` | `false` | show temperature in both units (15°C (59°F)) or in one (15°C) |
|
||||
| `both_units_popup` | `false` | same as above but for popup |
|
||||
| `notification_position` | `top_right` | The notification position |
|
||||
| coordinates | Required | Table with two elements: latitude and longitude, e.g. `{46.204400, 6.143200}` |
|
||||
| api_key | Required | Get it [here](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://openweathermap.org/appid) |
|
||||
| font_name | `beautiful.font:gsub("%s%d+$", "")` | **Name** of the font to use e.g. 'Play' |
|
||||
| both_units_widget | false | Show temperature in both units - '28°C (83°F) |
|
||||
| units | metric | `metric` for celsius, `imperial` for fahrenheit |
|
||||
| show_hourly_forecast | false | Show hourly forecase section |
|
||||
| time_format_12h |false | 12 or 24 hour format (13:00 - default or 1pm) |
|
||||
| show_daily_forecast | false | Show daily forecast section |
|
||||
| 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 | `.svg` | File extension of icons in the pack |
|
||||
|
||||
|
||||
### Example:
|
||||
### Icons:
|
||||
|
||||
Widget comes with two predefined icon packs:
|
||||
|
||||
- weather-underground-icons taken from [here](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://github.com/manifestinteractive/weather-underground-icons)
|
||||
- VitalyGorbachev taken from [here](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://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
|
||||
|
||||
![example1](../awesome-wm-widgets/assets/img/screenshots/weather-widget/screenshots/example1.png)
|
||||
|
||||
```lua
|
||||
weather_widget({
|
||||
api_key = 'your-api-key',
|
||||
weather_curl_widget({
|
||||
api_key='<your-key>',
|
||||
coordinates = {45.5017, -73.5673},
|
||||
time_format_12h = true,
|
||||
units = 'imperial',
|
||||
font = 'Ubuntu Mono 9'
|
||||
both_units_widget = true,
|
||||
font_name = 'Carter One',
|
||||
icons = 'VitalyGorbachev',
|
||||
show_hourly_forecast = true,
|
||||
show_daily_forecast = true,
|
||||
}),
|
||||
```
|
||||
|
||||
#### Only current weather
|
||||
|
||||
![example2](../awesome-wm-widgets/assets/img/screenshots/weather-widget/screenshots/example2.png)
|
||||
|
||||
```lua
|
||||
weather_curl_widget({
|
||||
api_key='<your-key>',
|
||||
coordinates = {45.5017, -73.5673},
|
||||
}),
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install lua socket - to make HTTP calls to get the weather information.
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install lua-socket
|
||||
```
|
||||
|
||||
1. Download json parser for lua from [github.com/rxi/json.lua](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://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
|
||||
|
@ -69,15 +103,27 @@ weather_widget({
|
|||
layout = wibox.layout.fixed.horizontal,
|
||||
...
|
||||
--default
|
||||
weather_widget({api_key = 'your-api-key'}),
|
||||
--customized
|
||||
weather_widget({
|
||||
api_key = 'your-api-key',
|
||||
api_key='<your-key>',
|
||||
coordinates = {45.5017, -73.5673},
|
||||
}),
|
||||
,
|
||||
--customized
|
||||
weather_curl_widget({
|
||||
api_key='<your-key>',
|
||||
coordinates = {45.5017, -73.5673},
|
||||
time_format_12h = true,
|
||||
units = 'imperial',
|
||||
font = 'Ubuntu Mono 9'
|
||||
})
|
||||
both_units_widget = true,
|
||||
font_name = 'Carter One',
|
||||
icons = 'VitalyGorbachev',
|
||||
show_hourly_forecast = true,
|
||||
show_daily_forecast = true,
|
||||
}),
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
You can read how it works in more details [here](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttp://pavelmakhov.com/2017/02/weather-widget-for-awesome-wm)
|
||||
## How it works
|
||||
|
||||
TBW
|
||||
|
|
Loading…
Reference in New Issue