https://github.com/dtinth/discord-plays-linux
A shared desktop on Discord?????
https://github.com/dtinth/discord-plays-linux
discordjs docker electron pulseaudio xvfb
Last synced: 3 months ago
JSON representation
A shared desktop on Discord?????
- Host: GitHub
- URL: https://github.com/dtinth/discord-plays-linux
- Owner: dtinth
- Created: 2021-07-25T12:44:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-28T07:40:31.000Z (almost 5 years ago)
- Last Synced: 2025-07-16T05:52:10.374Z (11 months ago)
- Topics: discordjs, docker, electron, pulseaudio, xvfb
- Language: JavaScript
- Homepage:
- Size: 198 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord Plays Linux
A shared Linux container that can be controlled by anyone on Discord.
## Bot commands
| Command | Description |
| ------------ | ---------------------------------------------------- |
| `m,` | Move the mouse by the given offset. |
| `M,` | Move the mouse to the given position. |
| `l,` | Drag the mouse by the given offset. |
| `L,` | Drag the mouse to the given position. |
| `f ` | Move mouse cursor to the given text (uses OCR). |
| `c` | Click the mouse. |
| `rc` | Right-click the mouse. |
| `mc` | Middle-click the mouse. |
| `u`, `uu`, … | Scroll the mouse wheel up (by the number of `u`s). |
| `d`, `dd`, … | Scroll the mouse wheel down (by the number of `d`s). |
| `k …` | Press the keyboard key. |
| `t ` | Type the given text. |
| `e` | Press the enter key. |
| `y ` | Copy the given text to the clipboard. |
## Components
- Two desktop Linux containers:
- `discord` for connecting to Discord and share the screen.
- `desktop` for the actual desktop.
- An agent to control the VM.
- A Discord bot that talks to the agent.

## Notes for server operators
```sh
# Start all services
docker-compose up -d
# Tail logs
docker-compose logs --tail=100 -f
# Access desktop as root
docker-compose exec desktop bash
# Access desktop as desktop user
docker-compose exec desktop su desktop
# Restart agent (sometimes required when transparency is not working)
docker-compose exec desktop supervisorctl restart agent
# Stop OCR system (when CPU overloaded)
docker-compose exec desktop supervisorctl stop ocr
# Recreate the Desktop docker container (when someone `rm -rf`’d it)
docker-compose up -d --force-recreate desktop
# Tail agent logs
docker-compose exec desktop supervisorctl tail -f agent
# Show overlay
docker-compose exec discord sudo -u desktop -H /opt/overlay/start.sh
# Pipe sound from desktop to Discord
pacmd load-module module-tunnel-source server=desktop source=virtual.monitor source_name=desktop
# Pipe video from desktop to Discord
ffplay -fs -f x11grab -video_size 1280x720 -i desktop:1.0
```