Skip to main content

Display running QEMU virtual machines as Discord Rich Presence status

Project description

QEMU Discord RPC

A Python script that displays your running QEMU virtual machines as Discord Rich Presence status.

Features

  • 🖥️ Automatically detects running QEMU virtual machines
  • 🎮 Shows VM status on your Discord profile
  • ⏱️ Displays how long the VM has been running
  • 🔄 Real-time updates every 15 seconds
  • 💾 Saves Discord application settings locally
  • 🚀 Lightweight and easy to use

Prerequisites

  • Python 3.6 or higher
  • Discord application
  • QEMU virtual machines
  • Linux/Unix system (uses ps aux command)

Installation

  1. Clone this repository:
git clone https://github.com/qubixq/qemu-discord-rpc.git
cd qemu-discord-rpc
  1. Install required dependencies:
pip install pypresence

Setup

1. Create a Discord Application

  1. Go to Discord Developer Portal
  2. Click "New Application" and give it a name (e.g., "QEMU VM Status")
  3. Copy the Application ID (Client ID) from the General Information page
  4. You can also upload a custom icon for your application

2. Configure the Script

  1. Run the script for the first time:
python qemu_discord_rpc.py
  1. When prompted, enter your Discord Application Client ID
  2. The script will save this ID to config.json for future use

Usage

Simply run the script while your QEMU virtual machines are running:

python qemu_discord_rpc.py

The script will:

  • Detect running QEMU VMs by looking for guest= parameter in process list
  • Update your Discord status to show the VM name and runtime
  • Continue monitoring until you stop it with Ctrl+C

Example Discord Status

🖥️ Playing QEMU VM
Windows-11 VM is running
Started 25 minutes ago

Configuration

The script creates a config.json file to store your Discord Application Client ID:

{
    "client_id": "your_discord_application_id_here"
}

You can manually edit this file if needed, or delete it to reconfigure.

How It Works

  1. VM Detection: Uses ps aux to find QEMU processes
  2. Name Extraction: Parses the guest= parameter from QEMU command line
  3. Discord RPC: Uses pypresence library to communicate with Discord
  4. Status Updates: Updates every 15 seconds, clears when no VMs are running

Requirements

  • pypresence - Discord Rich Presence library for Python

Install with:

pip install pypresence

Troubleshooting

Script doesn't detect VMs

  • Ensure your QEMU command includes the guest= parameter
  • Check that QEMU processes are visible with ps aux | grep qemu

Discord status not showing

  • Make sure Discord is running and you're logged in
  • Verify your Discord Application Client ID is correct
  • Check that your Discord privacy settings allow Rich Presence

Multiple VMs

  • Currently shows only the first detected VM
  • Feel free to modify the script for multiple VM support

Contributing

Contributions are welcome! Please feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

Acknowledgments

  • pypresence - Discord RPC library
  • QEMU community for the amazing virtualization platform

Note: This script is designed for Linux/Unix systems.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qemu_discord_rpc-1.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qemu_discord_rpc-1.0.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file qemu_discord_rpc-1.0.0.tar.gz.

File metadata

  • Download URL: qemu_discord_rpc-1.0.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for qemu_discord_rpc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bf5261945abfe527d918e7a4780f2d17327b2188b680bb54f5718b2f02dfdddf
MD5 0666acd971ff6b33c642b81392a50656
BLAKE2b-256 61b26c9c54d923d3ac75e897386db27bc4df3c64cdd5188548dddea0e680a90d

See more details on using hashes here.

File details

Details for the file qemu_discord_rpc-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qemu_discord_rpc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1a3a12f4e659197bf7c4e1e56f62d412bb81c7e74abb0f3be7f776a4c91dbb
MD5 6016038e84cf03aaaad68c9b48174896
BLAKE2b-256 94cd6727c4eb74446999645dfec725cf65a7f4e9c3aa73a32a96dccf3dc42967

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page