A dynamic, 7-day rolling GitHub heatmap with a custom purple theme 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 purple colored heatmap (■) with detailed tooltips. Designed for seamless integration with status bars like Waybar, Polybar, or any custom desktop widget.
The heatmap utilizes the following color logic based on daily commit count:
| Contributions | Color 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
Add the following block to your Waybar config.jsonc. (Make sure to update the path to where you placed the script and change the github URL to your own):
"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"
}
chmod +x ~/.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;
background: rgba(30, 30, 46, 0.89);
border-radius: 6px;
margin-right: 2px;
padding: 0px 8px;
}