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.1.tar.gz (16.3 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.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qemu_discord_rpc-1.0.1.tar.gz
  • Upload date:
  • Size: 16.3 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.1.tar.gz
Algorithm Hash digest
SHA256 0fa5ca5800ceb92996c3496a96a4039c1a89d8e4eeaa5fb731e6500c5998d928
MD5 ccc1d2db21bfe481457b7d627853bb99
BLAKE2b-256 c6380130b0ad271ae72e6a9ec198955bbebc30914e39723a43eb8b12cab0efff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qemu_discord_rpc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85d5f02e45953b32be742cc2480a5bfd4eac22c321539a8eb472ac2527a11be1
MD5 63d385310c21fcafa6c3e5374271f3dc
BLAKE2b-256 036d27333074ad69a7785d8b616727601e164f9554756ea8a24bdf0395836259

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