Ahmed x86 - gh-radar for Waybar 📡

A dynamic and interactive Waybar module that monitors your GitHub activity in real-time.

Python Waybar GitHub API Arch Linux
Watch gh-radar's animated ticker and notifications in action!

✨ Key Features


🛠️ Installation & Setup

1. Clone & Copy Files

git clone https://github.com/ahmed-x86/gh-radar.git
cd gh-radar

# Copy sound to your config
cp -r sounds ~/.config/

# Setup Waybar scripts directory
mkdir -p ~/.config/waybar/scripts
cp github_radar.py ~/.config/waybar/scripts/
chmod +x ~/.config/waybar/scripts/github_radar.py

2. Add Your Credentials (.env)

Create a .env file to authenticate with GitHub:

nano ~/.config/waybar/scripts/.env

Add the following (replace with your info):

GITHUB_USERNAME=your_github_username
GITHUB_PAT=your_personal_access_token_here

3. Install Dependencies

Depending on your Linux distribution, install the required Python libraries. You also need an audio player (mpv or paplay) and a notification daemon (libnotify).

For Arch Linux / Manjaro:

sudo pacman -S python-requests python-dotenv

For Ubuntu / Debian (or using pip):

pip install requests python-dotenv

⚙️ Usage & Arguments

The script supports arguments to customize its behavior:

# Examples:
github_radar.py                    # Tracks everything, dynamic polling, default icon
github_radar.py my_repos_only -icon 2 # Tracks only your repos, uses Octocat icon
github_radar.py -t 0               # Tracks everything, manual refresh ONLY
github_radar.py my_repos_only -t 0 -icon 5 # Tracks only your repos, manual refresh ONLY, Git logo

🖥️ Waybar Configuration

1. Module Configuration (config.jsonc)

💡 Pro Tip: Add "reload_style_on_change": true, at the very top of your Waybar config file. This allows Waybar to instantly apply changes when you edit the config or style files without needing a manual restart!

Add this module to your Waybar config file (under modules-left, modules-center, or modules-right):

"custom/github-radar": {
    "format": "{}",
    "return-type": "json",
    "exec": "~/.config/waybar/scripts/github_radar.py my_repos_only -t 0 -icon 2", // Customize args here!
    "on-click": "xdg-open https://github.com/ahmed-x86",
    "on-click-right": "xdg-open https://github.com/notifications",
    "on-click-middle": "pkill -USR1 -f github_radar.py", // Sends the refresh signal
    "restart-interval": 0 // Set to 0 because the script runs its own background loop
}

(Note: Change ahmed-x86 to your actual GitHub username in the on-click URL).

2. Styling (style.css)

Choose the theme that matches your current Waybar setup and add it to your style.css.

1. Default (GitHub Dark)
/* GitHub Radar - Default Theme */
#custom-github-radar {
    background-color: #24292e; /* Dark GitHub background */
    color: #ffffff;
    border-radius: 10px;
    padding: 0px 10px;
    margin: 4px 5px;
    font-weight: bold;
    border: 1px solid #444c56;
    transition: all 0.3s ease;
}

#custom-github-radar:hover {
    background-color: #2ea043; /* GitHub green */
    color: #ffffff;
    border-color: #2ea043;
}
2. Catppuccin (Mocha)
/* GitHub Radar - Catppuccin Mocha Theme */
#custom-github-radar {
    background-color: #1e1e2e; /* Base */
    color: #cdd6f4; /* Text */
    border-radius: 10px;
    padding: 0px 10px;
    margin: 4px 5px;
    font-weight: bold;
    border: 1px solid #313244; /* Surface0 */
    transition: all 0.3s ease;
}

#custom-github-radar:hover {
    background-color: #a6e3a1; /* Green */
    color: #11111b; /* Crust for contrast */
    border-color: #a6e3a1;
}
3. Dracula
/* GitHub Radar - Dracula Theme */
#custom-github-radar {
    background-color: #282a36; /* Background */
    color: #f8f8f2; /* Foreground */
    border-radius: 10px;
    padding: 0px 10px;
    margin: 4px 5px;
    font-weight: bold;
    border: 1px solid #44475a; /* Selection */
    transition: all 0.3s ease;
}

#custom-github-radar:hover {
    background-color: #50fa7b; /* Green */
    color: #282a36; /* Background for contrast */
    border-color: #50fa7b;
}
Restart Waybar: Apply the changes by restarting Waybar using killall waybar && waybar & disown (Only needed if you haven't enabled reload_style_on_change).
View GitHub Repository