How pandorasfox/dms-discord-widget works
This repo is a small DankMaterialShell plugin that adds a Discord voice status widget to DankBar. It is not a standalone app; it plugs into DMS through the plugin system described by plugin.json and the QML components.
The architecture has three main parts:
1. UI widget layer: DiscordVoiceWidget.qml
2. Settings/configuration layer: DiscordVoiceSettings.qml
3. Local Python bridge: discord_bridge.py
The widget layer is the visible runtime surface in the bar and the popout. It renders Discord voice participants as circular avatars and shows live status indicators for speaking, mute, and deafen states. The widget also acts as the user entry point for authorization and for opening the popout.
The settings layer exposes plugin configuration inside DMS Settings. From the README, the only explicit setting is the maximum number of avatars shown in the bar. This implies the widget is designed to adapt its layout based on a user-defined cap rather than showing the full channel roster unbounded.
The Python bridge is the backend component that likely handles Discord communication and state synchronization. It requires Python 3.10+, which is important because it means the plugin depends on a local Python runtime rather than only QML/Qt. Its job is to connect to Discord after authorization, track voice participants and speaking state, and expose data/actions back to the QML side.
A key architectural boundary is the authorization flow. The user clicks “Authorize Discord,” Discord presents a consent dialog, and once authorized the plugin auto-connects on later launches. This suggests the bridge persists credentials/tokens locally and reuses them to restore state without repeating setup.
Another important boundary is the IPC command interface. The plugin registers an IPC target named discord, exposing command-style actions such as mute/deafen toggles and a status query. This makes the plugin controllable from outside the widget, so keybinds or compositor bindings can drive Discord voice state independently of the UI.
The data flow is likely:
Discord authorization and voice presence data -> Python bridge -> QML widget state -> bar/popout rendering.
In the opposite direction:
UI clicks or IPC calls -> Python bridge -> Discord mute/deafen actions.
The runtime model is local and event-driven. There is no evidence of a remote service hosted by the repo itself; instead it integrates with Discord and DMS on the user’s machine. The architecture therefore centers on local state propagation and UI synchronization rather than networked backend services.
The repo’s integration surface with DankMaterialShell is the plugin mechanism: the manifest plus QML files allow DMS to discover the plugin, present it in the plugin browser, and mount the widget/settings UI into the shell. The manual install path in the README reinforces that this is a drop-in plugin directory under the DMS plugins path.
For an architecture diagram, the clearest boxes are:
• DankMaterialShell / DankBar
• Discord Voice widget UI (QML)
• Discord Voice settings UI (QML)
• Python Discord bridge
• Discord API / OAuth consent
• DMS IPC callers for mute/deafen/status commands
The main boundaries to show are UI vs bridge, local plugin vs Discord network service, and interactive widget controls vs external IPC control.
Main entry points: discord_bridge.py Discord bridge · DiscordVoiceWidget.qml Voice widget · plugin.json Plugin manifest · DiscordVoiceSettings.qml Settings panel
Components 8
DMS integration
Plugin discovery and mounting inside DankMaterialShell / DankBar.
- DankMaterialShell · The host environment that loads the plugin, renders the bar widget, and mounts settings UI.
- Plugin manifest · Declares the plugin to DMS and wires the package into the shell.
plugin.json
QML UI
Visible widget and settings surfaces implemented in QML.
- Voice widget · Bar and popout UI that shows Discord voice participants and live speaking/mute/deafen status.
DiscordVoiceWidget.qml - Settings panel · Configuration UI exposed in DMS Settings, including the avatar display cap.
DiscordVoiceSettings.qml
Local backend
Python bridge that manages Discord state and actions.
- Discord bridge · Local Python runtime that connects to Discord, syncs voice presence, and performs state-changing actions.
discord_bridge.py
External systems
Discord and other local callers outside the plugin UI.
- Authorize flow · User consent path used to grant the plugin access and establish a reusable local connection state.
- Discord · Discord voice and authorization endpoints consumed by the bridge.
- IPC callers · Keybinds or other local automation that invoke discord commands outside the widget.
Connections 12
- DankMaterialShell → Plugin manifest: discovers · DMS loads the plugin through its manifest.
- Plugin manifest → Voice widget: mounts · The manifest exposes the widget surface to the shell.
- Plugin manifest → Settings panel: registers · The manifest exposes the settings surface to DMS Settings.
- Voice widget → Discord bridge: reads state · The QML widget consumes participant and status data from the Python bridge.
- Voice widget → Discord bridge: sends actions · Widget controls trigger authorization and voice-state actions through the bridge.
- Settings panel → Voice widget: configures · Settings adjust widget behavior such as avatar limits.
- Discord bridge → Authorize flow: requests consent · The bridge initiates the Discord authorization flow.
- Authorize flow → Discord: grants access · User consent enables the plugin to talk to Discord.
- Discord bridge → Discord: syncs voice · The bridge tracks voice participants and speaking state from Discord.
- IPC callers → Discord bridge: commands · External IPC target actions invoke mute, deafen, and status operations.
- Discord bridge → IPC callers: exposes target · The bridge provides the discord IPC command surface.
- Discord bridge → Voice widget: publishes updates · Backend state changes are reflected back into the visible widget.