Like Discord Rich Presence, but for anywhere!
A lightweight, adaptive presence detection system that monitors your current activity and provides real-time status updates via a REST API and WebSocket connection.
- Smart Application Detection: Automatically detects and prioritizes running applications
- VSCode Integration: Deep integration with VS Code to show current file and project
- Tiered Priority System: Prioritizes coding activities over browsing or entertainment
- Real-time Updates: WebSocket support for live presence streaming
- Adaptive Polling: Faster updates when active, slower when idle for optimal performance
- REST API: Simple HTTP endpoints for presence data
- Lightweight: Optimized Rust backend with minimal resource usage
The system intelligently detects and categorizes applications by priority:
Tier 1 (Highest Priority)
code- Visual Studio Code (shows current file when extension is installed)discord- Discord
Tier 2 (Work & Browsing)
zen- Zen Browserchrome- Google Chromesteam- Steam
Tier 3 (Entertainment)
vlc- VLC Media Playerstremio- Stremio
Tier 4 (Development Tools)
ghostty- Ghostty Terminal
- Rust (latest stable version)
- Git
-
Clone and build:
git clone https://github.com/bilgi42/represence cd represence cargo build --release -
Install globally:
# Install via cargo (recommended) cargo install --path . # Or copy manually sudo cp target/release/represence /usr/local/bin/ sudo chmod +x /usr/local/bin/represence
-
Run the service:
# Run directly represence # Or run in background nohup represence > /dev/null 2>&1 &
For detailed file information when coding, install the companion VSCode extension:
- Download
represence-vscode-0.0.2.vsixfrom therepresence-vscodedirectory - Install:
code --install-extension represence-vscode-0.0.2.vsix - The extension automatically starts when VSCode launches
| Variable | Default | Description |
|---|---|---|
REPRESENCE_PORT |
3001 |
Port for the main API server |
export REPRESENCE_PORT=8080
represenceThe service runs on http://localhost:3001 (or your configured port) with the following endpoints:
Get current presence data.
Response:
{
"text": "editing main.rs in Visual Studio Code"
}Health check and service information.
Response:
{
"status": "healthy",
"timestamp": 1704067200,
"version": "0.1.0",
"endpoints": {
"presence": "/api/represence",
"websocket": "/ws/represence",
"health": "/health"
}
}API information and welcome message.
Real-time presence updates via WebSocket.
Example Usage:
const ws = new WebSocket('ws://localhost:3001/ws/represence');
ws.onmessage = (event) => {
const presence = JSON.parse(event.data);
console.log('Current activity:', presence.text);
};-
Create service file:
sudo tee /etc/systemd/system/represence.service << EOF [Unit] Description=Represence Rich Presence Service After=network.target [Service] Type=simple User=$USER ExecStart=$(which represence) Restart=always RestartSec=3 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target EOF
-
Enable and start:
sudo systemctl daemon-reload sudo systemctl enable represence sudo systemctl start represence sudo systemctl status represence
curl http://localhost:3001/api/represence
# Output: {"text":"editing README.md in Visual Studio Code"}#!/bin/bash
while true; do
STATUS=$(curl -s http://localhost:3001/api/represence | jq -r '.text')
echo "$(date '+%H:%M:%S'): $STATUS"
sleep 10
doneasync function getCurrentActivity() {
const response = await fetch('http://localhost:3001/api/represence');
const data = await response.json();
return data.text;
}
// Usage
getCurrentActivity().then(activity => {
document.getElementById('status').textContent = activity;
});- Process Detection: Scans
/procdirectory for running applications - Smart Caching: Caches process information with change detection
- Adaptive Timing: 1-second updates when active, 3-second when idle
- VSCode Integration: Connects to VSCode extension via WebSocket for file details
- Priority System: Shows highest-priority activity from detected applications
git clone https://github.com/bilgi42/represence
cd represence
cargo build --releasecargo test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
# Stop service (if using systemd)
sudo systemctl stop represence
sudo systemctl disable represence
sudo rm /etc/systemd/system/represence.service
sudo systemctl daemon-reload
# Remove binary
cargo uninstall represence
# Or if installed manually:
sudo rm /usr/local/bin/represenceThis project is open source. See the LICENSE file for details.
Made with β€οΈ for developers who want to share their current vibe

