Skip to content

verseles/crossbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Crossbar

Universal Plugin System for Taskbar/Menu Bar - Write Once, Run Everywhere

CI codecov License Flutter Dart Platform

Crossbar is a revolutionary cross-platform plugin system inspired by BitBar (macOS) and Argos (Linux), bringing the power of scriptable status bar widgets to all platforms - desktop and mobile.

#!/usr/bin/env python3
# This plugin works WITHOUT MODIFICATION on:
# Linux, Windows, macOS, Android, iOS
import subprocess, json

cpu = subprocess.run(['crossbar', 'cpu'], capture_output=True, text=True)
print(json.dumps({
    "icon": "โšก",
    "text": f"{cpu.stdout.strip()}%",
    "menu": [{"text": "Details", "bash": "crossbar process list"}]
}))

โœจ Features

๐Ÿš€ Core Capabilities

  • ๐ŸŒ True Cross-Platform: One plugin, five target platforms (Linux, macOS, Windows, Android, iOS)
  • 8๏ธโƒฃ Multi-Language Support: Write plugins in Bash, Python, Node.js, Dart (Interpreted & Compiled), Go, Rust, or YAML
  • โšก Hot Reload: Automatic plugin detection and reload (<1s)
  • ๐ŸŽจ Adaptive Rendering: Same plugin renders as tray icon, notification, or widget
  • ๐Ÿ”’ Secure Storage: Passwords stored in system Keychain/KeyStore
  • ๐ŸŒ 75+ CLI Commands: Unified API for system info, network, media, clipboard, and more

๐ŸŽฏ Revolutionary Advantages Over BitBar/Argos

Feature BitBar/Argos Crossbar
Platforms macOS/Linux only Linux + Windows + macOS + Android + iOS
Output Formats Text only Text + JSON + Structured Data
UI Targets Menu bar only Tray + Notifications + Widgets + Menu bar
CLI API None (scripts call system commands) 75+ unified commands (crossbar cpu)
Configuration Manual scripting Declarative JSON with auto-generated UI
Mobile Support โŒ None โœ… Widgets + Persistent Notifications (Android) + Home/Lock Screen Widgets (iOS)
Controls Read-only Bidirectional (volume, media, system)
Hot Reload Manual refresh Automatic file watching

๐Ÿ“ฑ Platform-Specific Features

Desktop (Linux/macOS/Windows)

  • System tray integration with custom icons
  • Menu bar dropdown with unlimited items
  • Window management and theming
  • Tray Display Mode (Settings โ†’ System Tray):
    • Unified: Single tray icon with menu for all plugins (default)
    • Separate: One tray icon per plugin (Linux only, coming soon)
    • Smart Collapse/Overflow: Automatic modes (coming soon)

Mobile (Android/iOS)

  • Home screen widgets (1x1, 2x2, 4x4 layouts)
  • Persistent notifications (Android foreground service)
  • Lock screen widgets (iOS)

๐Ÿš€ Quick Start

Installation

1. Development Setup (Recommended for Contributors)

If you plan to develop plugins or contribute to Crossbar core, we recommend setting up the full environment.

Prerequisites:

  • Flutter 3.35.0+ (Install Flutter)
  • Dart 3.10.0+ (comes with Flutter)
  • make (optional, for easier build commands)

Setup:

# Clone the repository
git clone https://github.com/verseles/crossbar.git
cd crossbar

# Install dependencies
flutter pub get

# Build and Run (Desktop)
# Using Makefile (Recommended - builds full architecture)
make linux   # or make macos, make windows

# Or using Flutter directly (GUI only)
flutter run -d linux

2. Download Pre-built Binaries (For Users)

Download the latest release from GitHub Releases.

Linux: Extract crossbar-linux.zip and run:

./crossbar          # Launch (Start in Tray)
./crossbar gui      # Launch GUI (Open Window)
./crossbar --help   # Show CLI commands
./crossbar cpu      # Example CLI usage

Your First Plugin

  1. Create a plugin file in ~/.crossbar/plugins/ (plugins can be files in the root or inside subdirectories):
#!/bin/bash
# ~/.crossbar/plugins/hello.10s.sh
echo "๐Ÿ‘‹ Hello Crossbar!"
echo "---"
echo "System: $(uname -s)"
echo "Refresh | refresh=true"
  1. Make it executable:
chmod +x ~/.crossbar/plugins/hello.10s.sh
  1. The plugin will auto-refresh every 10 seconds (from filename *.10s.sh)

๐Ÿ“– Documentation

Plugin Types

Crossbar supports multiple plugin types for different use cases:

Type Extension Platforms Use Case
YAML .yaml All โœ… Simple data display, no code needed
Dart Interpreted .dart All โœ… Logic without external packages
Script .sh, .py, .js Desktop Existing scripts, shell commands
Dart Compiled .dart.exe Desktop Full Dart with any package

Quick Examples:

# YAML Plugin - weather.30m.yaml
name: Weather
source:
  type: http
  url: "https://api.example.com/weather"
output:
  text: "๐ŸŒก๏ธ ${response.temp}ยฐC"
// Dart Plugin - clock.1s.dart
import 'package:crossbar_bridge/crossbar_bridge.dart';

void main() {
  final crossbar = CrossbarBridge();
  print('โฐ ${crossbar.time()}');
}

๐Ÿ“– Detailed Guides:

Plugin Format

Crossbar supports two output formats:

1. BitBar Text Format (Legacy Compatible)

#!/bin/bash
echo "๐Ÿ”‹ 85%"          # Tray text (first line)
echo "---"             # Separator
echo "Status | color=green"
echo "Details | bash='crossbar battery --json'"

Attributes:

  • color=red|blue|#FF0000 - Text color
  • bash='command' - Execute on click
  • refresh=true - Refresh all plugins on click
  • href='https://url' - Open URL on click
  • font=Monaco - Custom font
  • size=12 - Font size

2. JSON Format (Recommended)

#!/usr/bin/env python3
import json
print(json.dumps({
    "icon": "๐Ÿ”‹",
    "text": "85%",
    "tooltip": "Battery Level",
    "color": "#00FF00",
    "menu": [
        {"text": "Show Details", "bash": "crossbar battery --json"},
        {"text": "---"},  # Separator
        {"text": "Settings", "href": "https://settings"}
    ]
}))

CLI API Reference

Crossbar provides 75+ unified commands accessible via crossbar [command].

System Information

crossbar cpu                # CPU usage (0-100)
crossbar memory             # Memory usage (e.g., "8.2/16 GB")
crossbar battery            # Battery status
crossbar disk               # Disk usage
crossbar uptime             # System uptime
crossbar hostname           # Machine hostname
crossbar username           # Current user
crossbar kernel             # Kernel version
crossbar arch               # Architecture (x64, arm64)
crossbar os                 # Operating system

Network

crossbar net status         # "online" | "offline" | "wifi"
crossbar net ip             # Local IP address
crossbar net ip --public    # Public IP (via ipify.org)
crossbar net ping google.com # Ping latency
crossbar wifi status        # WiFi status
crossbar wifi ssid          # WiFi network name
crossbar bluetooth status   # "on" | "off"
crossbar vpn status         # VPN status

Device & Hardware

crossbar screen size        # Screen resolution
crossbar screen brightness  # Get brightness
crossbar power sleep        # Suspend system
crossbar wallpaper          # Get current wallpaper path

Audio & Media

crossbar audio volume             # Current volume (0-100)
crossbar audio volume 50          # Set volume
crossbar audio mute               # Toggle mute
crossbar media playing --json     # Current media info
crossbar media play               # Resume playback
crossbar media pause
crossbar media next
crossbar media prev

Clipboard

crossbar clipboard                # Get clipboard text
crossbar clipboard "text"         # Copy to clipboard

File Operations

crossbar file exists /path/file
crossbar file read /path/file
crossbar file size /path/file
crossbar dir list /path/dir

Time & Utilities

crossbar time [12h|24h]
crossbar date
crossbar uuid                     # Generate UUID
crossbar random [min] [max]
crossbar hash "text"
crossbar base64 encode "text"
crossbar base64 decode "dGV4dA=="
crossbar exec "command"           # Execute shell command
crossbar notify "Title" "Msg"     # Send notification
crossbar open url "https://..."   # Open URL
crossbar open file "/path/..."    # Open file

See full API: original_plan_specs.md

Plugin Configuration

Plugins can declare their configuration needs:

// ~/.crossbar/plugins/weather.30m.py.schema.json
{
  "name": "Weather Plugin",
  "description": "Shows current weather",
  "version": "1.0.0",
  "settings": [
    {
      "key": "API_KEY",
      "type": "password",
      "label": "OpenWeather API Key",
      "required": true
    },
    {
      "key": "LOCATION",
      "type": "text",
      "label": "City Name",
      "default": "Sรฃo Paulo"
    },
    {
      "key": "UNITS",
      "type": "select",
      "label": "Temperature Units",
      "options": ["metric", "imperial"],
      "default": "metric"
    }
  ]
}

Crossbar automatically generates a configuration dialog with proper UI controls.

Environment Variables

Every plugin receives these variables:

CROSSBAR_OS=linux              # Platform (linux/macos/windows/android/ios)
CROSSBAR_DARK_MODE=true        # System theme
CROSSBAR_VERSION=1.0.0         # Crossbar version
CROSSBAR_PLUGIN_ID=cpu.10s.sh  # Plugin filename

# User configs (from .schema.json)
WEATHER_API_KEY=abc123         # Passwords from Keychain
WEATHER_LOCATION=Sรฃo Paulo
WEATHER_UNITS=metric

Detailed Documentation

For comprehensive documentation, see:

๐Ÿ“ฆ Example Plugins

Crossbar includes 24 example plugins in 6 languages:

Bash (8 plugins)

  • cpu.10s.sh - CPU usage with color coding
  • memory.10s.sh - RAM usage visualization
  • battery.30s.sh - Battery status with icon
  • disk.5m.sh - Disk space monitor
  • network.30s.sh - Network speed (up/down)
  • uptime.1m.sh - System uptime
  • spotify.5s.sh - Now playing on Spotify

Python (8 plugins)

  • weather.30m.py - Weather from OpenWeatherMap API
  • time.1s.py - Live clock
  • countdown.1s.py - Event countdown timer
  • todo.1m.py - Simple todo list
  • bitcoin.5m.py - BTC price from CoinGecko
  • github-notifications.5m.py - GitHub notifications
  • process-monitor.10s.py - Top CPU processes
  • quotes.1h.py - Random inspirational quotes

Node.js (6 plugins)

  • npm-downloads.1h.js - NPM package stats
  • ip-info.1h.js - Geolocation info
  • world-clock.1m.js - Multi-timezone clocks
  • pomodoro.1s.js - Pomodoro timer
  • emoji-clock.1m.js - Time as emojis

Dart (2 plugins)

  • system-info.1m.dart - Comprehensive system info
  • git-status.30s.dart - Current repo status

๐Ÿ—๏ธ Architecture

crossbar/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ core/                   # Core plugin system (Flutter)
โ”‚   โ”‚   โ”œโ”€โ”€ plugin_manager.dart       # Discovery & lifecycle
โ”‚   โ”‚   โ”œโ”€โ”€ script_runner.dart        # Execution engine
โ”‚   โ”‚   โ”œโ”€โ”€ output_parser.dart        # BitBar/JSON parser
โ”‚   โ”‚   โ””โ”€โ”€ api/                      # CLI commands
โ”‚   โ”œโ”€โ”€ models/                 # Data models
โ”‚   โ”œโ”€โ”€ services/               # Background services
โ”‚   โ”‚   โ”œโ”€โ”€ scheduler_service.dart    # Auto-refresh triggers
โ”‚   โ”‚   โ”œโ”€โ”€ refresh_service.dart      # Unified refresh engine
โ”‚   โ”‚   โ”œโ”€โ”€ tray_service.dart         # System tray
โ”‚   โ”‚   โ”œโ”€โ”€ hot_reload_service.dart   # File watcher
โ”‚   โ”‚   โ”œโ”€โ”€ marketplace_service.dart  # Plugin discovery
โ”‚   โ”‚   โ”œโ”€โ”€ logger_service.dart       # Rotating logs
โ”‚   โ”‚   โ”œโ”€โ”€ ipc_server.dart           # Inter-process communication
โ”‚   โ”‚   โ”œโ”€โ”€ notification_service.dart # Cross-platform notifications
โ”‚   โ”‚   โ”œโ”€โ”€ settings_service.dart     # User settings management
โ”‚   โ”‚   โ””โ”€โ”€ widget_service.dart       # Home screen widget updates
โ”‚   โ”œโ”€โ”€ ui/                     # User interface
โ”‚   โ””โ”€โ”€ l10n/                   # 10 languages
โ”œโ”€โ”€ packages/                   # Monorepo packages
โ”‚   โ”œโ”€โ”€ crossbar_core/                # Pure Dart shared APIs & models
โ”‚   โ”‚   โ””โ”€โ”€ lib/src/
โ”‚   โ”‚       โ”œโ”€โ”€ core/                 # Shared core utilities
โ”‚   โ”‚       โ”œโ”€โ”€ models/               # Plugin, Config models
โ”‚   โ”‚       โ””โ”€โ”€ api/                  # System, Network, Media APIs
โ”‚   โ””โ”€โ”€ crossbar_cli/                 # Pure Dart CLI package
โ”‚       โ”œโ”€โ”€ bin/crossbar.dart         # CLI entry point
โ”‚       โ””โ”€โ”€ lib/src/
โ”‚           โ”œโ”€โ”€ core/                 # CLI-specific plugin manager
โ”‚           โ””โ”€โ”€ commands/             # 75+ CLI command handlers
โ”œโ”€โ”€ plugins/                    # Example plugins
โ”œโ”€โ”€ test/                       # 116 tests (>90% coverage)
โ””โ”€โ”€ .github/workflows/          # CI/CD pipelines

๐Ÿงช Testing

# Run all tests
flutter test

# Run with coverage
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html

# Analyze code
flutter analyze

Current stats:

  • 116 tests (114 passing, 2 skipped)
  • 90% code coverage

  • 0 analysis errors

๐Ÿ”ง Development

Project Structure

  • Core: Plugin discovery, execution, parsing
  • Services: Background tasks, system integration
  • UI: Flutter Material Design 3 interface
  • CLI: Dart-based command-line API

Key Technologies

  • Flutter 3.35+ - Cross-platform framework
  • Dart 3.10+ - Type-safe language
  • tray_manager - System tray integration
  • dio - HTTP client for API calls
  • flutter_local_notifications - Push notifications
  • home_widget - Home screen widgets
  • flutter_secure_storage - Keychain integration

Adding a New CLI Command

  1. Add API method in lib/core/api/:
// lib/core/api/system_api.dart
Future<String> getHostname() async {
  final result = await Process.run('hostname', []);
  return result.stdout.toString().trim();
}
  1. Add CLI handler in lib/cli/cli_handler.dart (in the switch statement):
case 'hostname':
  print(Platform.localHostname);

Note: The main executable (crossbar) automatically supports both GUI (no args) and CLI (with args) modes.

  1. Add tests in test/unit/core/api/system_api_test.dart

๐ŸŒ Internationalization

Crossbar supports 10 languages:

  • ๐Ÿ‡บ๐Ÿ‡ธ English (en)
  • ๐Ÿ‡ง๐Ÿ‡ท Portuguese (pt)
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish (es)
  • ๐Ÿ‡ฉ๐Ÿ‡ช German (de)
  • ๐Ÿ‡ซ๐Ÿ‡ท French (fr)
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese (zh)
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese (ja)
  • ๐Ÿ‡ฐ๐Ÿ‡ท Korean (ko)
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian (it)
  • ๐Ÿ‡ท๐Ÿ‡บ Russian (ru)

Locale is auto-detected from system settings.

๐Ÿ“Š Performance

Metric Target Actual
Boot Time (desktop) <2s โœ… ~1.5s
Memory (idle, 3 plugins) <150MB โœ… ~120MB
Plugin Execution Overhead <50ms โœ… ~30ms
Hot Reload <1s โœ… ~500ms
Binary Size (Linux) <50MB โœ… 41MB

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Ways to Contribute

  • ๐Ÿ› Report bugs via GitHub Issues
  • ๐Ÿ’ก Suggest features
  • ๐Ÿ“ Improve documentation
  • ๐Ÿ”Œ Create and share plugins
  • ๐ŸŒ Add translations
  • ๐Ÿงช Write tests

๐Ÿ“„ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3).

This ensures that:

  • โœ… You can use, modify, and distribute the software
  • โœ… All derivatives must remain open source
  • โœ… SaaS deployments must share source code (network copyleft)
  • โœ… Community improvements benefit everyone

See LICENSE for full terms.

๐Ÿ™ Acknowledgments

Inspired by:

Built with:

  • Flutter - Google's UI toolkit
  • Dart - Client-optimized language

๐Ÿ“ž Support

๐Ÿ—บ๏ธ Roadmap

Full roadmap: See ROADMAP.md for detailed timeline, completed features, and technical debt tracking.

โœ… v1.4.0 (Current - 2025)

Mobile Mastery & Configuration Engine

  • Configuration Engine: JSON schema support, secure storage (Keychain), and UI generation.
  • Mobile Widgets: Native Android (XML) and iOS (WidgetKit) home screen widgets.
  • Refresh Engine: Unified behavior across UI, Tray and Background.
  • Core: Plugin Manager, Script Runner, Output Parser.
  • CLI: 75+ commands.
  • Platforms: Linux, macOS, Windows, Android, iOS.

๐ŸŽฏ v1.5.0 (Next)

Advanced Desktop UI & API Completion

  • Global Hotkey (Ctrl+Alt+C).
  • Tray Overflow Logic (Smart Collapse).
  • Window State Persistence.
  • New CLI commands: location, qr.

๐ŸŒŸ Visรฃo de Longo Prazo (v2.0.0+)

  • ๐ŸŒ Plugins remotos (execuรงรฃo server-side).
  • ๐Ÿ“Š Integraรงรฃo OpenTelemetry e Grafana.
  • ๐Ÿค– Sugestรตes de plugins com IA.
  • ๐Ÿ”— Plataforma de integraรงรฃo (webhooks, IFTTT/Zapier).
  • ๐ŸŽฎ Editor visual de plugins (no-code).
  • ๐ŸŒ Extensรฃo de navegador e suporte a smartwatch.

Quer influenciar o roadmap? Vote em funcionalidades nas GitHub Issues ou participe das Discussions!

๐Ÿ“œ Changelog

See CHANGELOG.md for the complete version history.

๐Ÿ”’ Security Policy

See SECURITY.md for security policy, vulnerability reporting, and best practices.

๐Ÿค Contributing

See CONTRIBUTING.md for contribution guidelines, development setup, and coding standards.

โญ Star History

If you find Crossbar useful, please consider giving it a star!


Made with โค๏ธ by the Crossbar Team

Website โ€ข GitHub โ€ข Twitter

About

Universal Plugin System for Taskbar/Menu Bar - Write Once, Run Everywhere

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •