Skip to content

Instantly share code, notes, and snippets.

@MightyCoderX
Created November 29, 2025 02:41
Show Gist options
  • Select an option

  • Save MightyCoderX/31d4965d72d807f3df14c9c83871270c to your computer and use it in GitHub Desktop.

Select an option

Save MightyCoderX/31d4965d72d807f3df14c9c83871270c to your computer and use it in GitHub Desktop.
Script to start moonlight as non root user from tty
#!/bin/bash
sudo chvt 3
# 1. Point to the physical terminal (so Qt knows where to paint)
export QT_QPA_EGLFS_TTY=/dev/tty2
# 2. Point to the standard user runtime directory (Vital for Audio/Wayland)
export XDG_RUNTIME_DIR=/run/user/$(id -u)
# 3. Point to the DBus session (Vital for PipeWire/PulseAudio discovery)
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
# 4. Launch Moonlight
QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_KMS_CONFIG=~/eglfs_card1.json moonlight-qt
sudo chvt 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment