A lightweight system tray application for Hyprland (Arch Linux) that enables quick switching of Clash proxy group nodes via a right-click context menu.
- System Tray Integration: Persistent tray icon with right-click menu
- Quick Node Switching: One-click switching between proxy nodes
- Visual Status Indicators: Icon changes color based on connection status
- Green: Connected and operational
- Red: Connection failed or error state
- Toast Notifications: Desktop notifications for successful switches and errors
- Auto-Refresh: Periodically updates proxy group information
- Minimal Overhead: <100ms response time, minimal CPU/RAM usage
- Wayland Native: Built for Hyprland with GTK4 support
- Arch Linux with Hyprland
- Clash or Clash Meta running with API enabled
- Rust toolchain (for building from source)
- Clone the repository:
git clone https://github.com/yourusername/clbar.git
cd clbar- Build the project:
cargo build --release- Install the binary:
sudo cp target/release/clbar /usr/local/bin/- (Optional) Install systemd service for auto-start:
mkdir -p ~/.config/systemd/user
cp clbar.service ~/.config/systemd/user/
systemctl --user enable clbar.service
systemctl --user start clbar.serviceyay -S clbarOn first run, clbar creates a default configuration file at ~/.config/clbar/config.toml:
# Clash API URL (default: http://127.0.0.1:9090)
clash_api_url = "http://127.0.0.1:9090"
# Clash API secret (leave empty if no authentication required)
clash_secret = ""
# Proxy groups to display in tray menu
# Empty list = show all groups
# Specify groups to filter: ["PROXY", "Fallback"]
proxy_groups = ["PROXY"]
# Auto-refresh interval in seconds
refresh_interval_secs = 30- clash_api_url: The URL of your Clash API endpoint
- clash_secret: Authentication token for Clash API (if required)
- proxy_groups: List of proxy groups to show in menu (empty = all groups)
- refresh_interval_secs: How often to refresh proxy group information
Note: If clbar command is not found, ensure ~/.cargo/bin is in your PATH:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc # for bash
# or
set -Ux fish_user_paths $HOME/.cargo/bin $fish_user_paths # for fishRun directly:
clbarOr use the full path:
~/.cargo/bin/clbarOr enable auto-start with systemd (recommended):
systemctl --user enable --now clbar.service- Right-click the tray icon to open the context menu
- Select a proxy group to view available nodes
- Click on a node to switch to it
- Use "Refresh" to manually update proxy groups
- Use "Quit" to exit the application
Add to your ~/.config/hypr/hyprland.conf:
exec-once = clbar
Or use the systemd service (recommended):
exec-once = systemctl --user start clbar.service
Ensure your Clash configuration has the API enabled:
# Clash config.yaml
external-controller: 127.0.0.1:9090
secret: "" # Optional: set a secret for authenticationIf you use a secret, update your clbar config:
clash_secret = "your-secret-here"- Ensure you're running Hyprland with a status bar that supports tray icons (e.g., Waybar)
- Check if the tray module is enabled in your Waybar config
- Verify Clash is running:
curl http://127.0.0.1:9090/proxies - Check the Clash API URL in config matches your setup
- Ensure no firewall is blocking local connections
- Install
libnotifyif not already installed:sudo pacman -S libnotify - Check your notification daemon is running
When running via systemd:
journalctl --user -u clbar.service -fcargo buildcargo runcargo test- Language: Rust
- UI Framework: tray-icon (Wayland/GTK4)
- HTTP Client: reqwest (async)
- Notifications: notify-rust
- Runtime: Tokio (async)
MIT License - see LICENSE file for details
Contributions welcome! Please open an issue or pull request.
Built for the Hyprland community on Arch Linux.