A dynamic, 7-day rolling GitHub heatmap with dynamic color palettes for your status bar.
A terminal or bar integration script that fetches your GitHub contribution activity for the last 7 rolling days using the GitHub GraphQL API and renders a custom colored heatmap (■) with detailed tooltips. Designed for seamless integration with status bars like Waybar, Polybar, or any custom desktop widget.
By default, the script uses a purple theme. However, you can pass any custom base color (representing the highest activity level 10+), and the script will automatically calculate and generate the lower-level gradients based on that color. The default mapping is:
| Contributions | Default Hex | Meaning |
|---|---|---|
| 0 | #161b22 | No contributions |
| 1–3 | #3d2258 | Low activity |
| 4–6 | #6a3896 | Moderate activity |
| 7–9 | #974ddb | High activity |
| 10+ | #c463ff | Very high activity |
git clone https://github.com/ahmed-x86/waybar-github-rolling-contributions.git
cd waybar-github-rolling-contributions
To make this module work, you need your GitHub username and a Fine-Grained Personal Access Token (PAT).
Repository access → All repositories.env FileInside the cloned project directory, create a .env file with the following content:
GITHUB_USERNAME=your_github_username
GITHUB_PAT=ghp_yourGeneratedTokenHere
Ensure the script is executable, then add the block below to your Waybar config.jsonc. You can customize the heatmap color by passing the -c or --color argument.
chmod +x ~/.config/waybar/scripts/weekly_commits
"custom/gh_heatmap": {
"exec": "sleep 1 & ~/.config/waybar/scripts/weekly_commits",
"return-type": "json",
"interval": 2400,
"tooltip": true,
"on-click": "xdg-open https://github.com/ahmed-x86",
"on-click-right": "~/.config/waybar/scripts/weekly_commits"
}
"custom/gh_heatmap": {
"exec": "sleep 1 & ~/.config/waybar/scripts/weekly_commits --color '#00ff00'",
"return-type": "json",
"interval": 2400,
"tooltip": true,
"on-click": "xdg-open https://github.com/ahmed-x86",
"on-click-right": "~/.config/waybar/scripts/weekly_commits"
}
"custom/gh_heatmap": {
"exec": "sleep 1 & ~/.config/waybar/scripts/weekly_commits --color '255,165,0'",
"return-type": "json",
"interval": 2400,
"tooltip": true,
"on-click": "xdg-open https://github.com/ahmed-x86",
"on-click-right": "~/.config/waybar/scripts/weekly_commits"
}
Add the following styling to your Waybar style.css. It fits perfectly with dark/Catppuccin backgrounds:
#custom-gh_heatmap {
color: #c463ff; /* Change this to match your custom base color if used */
background: rgba(30, 30, 46, 0.89);
border-radius: 6px;
margin-right: 2px;
padding: 0px 8px;
}