2020-09-18 04:52:25 +02:00
# Github Contributions Widget
2020-11-09 16:07:14 +01:00
The widget is inspired by the https://github-contributions.now.sh/ and relies on it's API.
2020-09-18 04:52:25 +02:00
2020-11-09 16:07:14 +01:00
It shows the contribution graph, similar to the one on the github profile page: ![screenshot ](./screenshots/screenshot.jpg )
You might wonder what could be the reason to have your github's contributions in front of you all day long? The more you contribute, the nicer widget looks! Check out [Thomashighbaugh ](https://github.com/Thomashighbaugh )'s graph:
![](./screenshots/Thomashighbaugh.png)
2020-09-18 04:52:25 +02:00
## Customization
It is possible to customize the widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
2020-11-09 16:07:14 +01:00
| `username` | `streetturtle` | GitHub username |
2023-09-21 00:01:55 +02:00
| `days` | 365 | Number of days in the past, more days - wider the widget |
2020-11-09 16:07:14 +01:00
| `color_of_empty_cells` | Theme's default | Color of the days with no contributions |
2023-09-21 00:01:55 +02:00
| `with_border` | true | Should the graph contains border or not |
| `margin_top` | 1 | Top margin |
2020-11-09 16:07:14 +01:00
| `theme` | `standard` | Color theme of the graph, see below |
_Note:_ widget height is 21px (7 rows of 3x3 cells). So it would look nice on the wibar of 22-24px height.
### Themes
2020-09-18 04:52:25 +02:00
2020-11-09 16:07:14 +01:00
Following themes are available:
| Theme name | Preview |
|---|---|
| standard | ![standard ](./screenshots/standard.png ) |
| classic | ![classic ](./screenshots/classic.png ) |
| teal | ![teal ](./screenshots/teal.png ) |
| leftpad | ![leftpad ](./screenshots/leftpad.png ) |
| dracula | ![dracula ](./screenshots/dracula.png ) |
| pink | ![pink ](./screenshots/pink.png ) |
To add a new theme, simply add a new entry in `themes` table (themes.lua) with the colors of your theme.
### Screenshots
2020-09-18 04:52:25 +02:00
2020-09-18 04:53:57 +02:00
1000 days, with border:
2020-11-09 16:07:14 +01:00
![screenshot1 ](./screenshots/screenshot1.jpg )
2020-09-18 04:52:25 +02:00
2020-09-18 04:53:57 +02:00
365 days, no border:
2020-11-09 16:07:14 +01:00
![screenshot2 ](./screenshots/screenshot2.jpg )
2020-09-18 04:52:25 +02:00
## Installation
Clone/download repo under ** ~/.config/awesome** and use widget in **rc.lua** :
```lua
local github_contributions_widget = require("awesome-wm-widgets.github-contributions-widget.github-contributions-widget")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
github_contributions_widget({username = '< your username > '}),
...
```