Last Rich Presence

Windows app for accurate, polished Discord Rich Presence for media, creative, and productivity workflows. Built with C++20 and WinUI 3.

Stable Release Windows 10/11 C++20 / WinUI 3 GPL-3.0
Last Rich Presence home view: connected to Discord, media activity detected from YouTube Music via a browser hint, and creativity activity detected from Adobe Photoshop

Overview

Last Rich Presence keeps Discord aligned with what you are actually doing on Windows, across three independent activity lanes: media playback read from Windows media sessions, creative work detected from Adobe-family desktop apps, and productivity work detected from Office-family apps. Each lane owns a separate Discord application, so a track, a Photoshop session, and a Word document can appear as distinct cards rather than fighting over one status.

The app is single-instance and tray-first: it can start minimized, close to tray, and redirect a second launch back to the running instance. An optional Chromium extension improves timeline accuracy for web players that Windows reports poorly.

Key Features

  • Media Lane Reads active Windows media sessions (GSMTC) and builds presence with title, artist, album, playback state, and timeline.
  • Creativity Lane Detects 23 Adobe-family desktop apps, from Photoshop and Premiere Pro through the Substance 3D suite, with project-name and window-title display.
  • Productivity Lane Detects Word, Excel, PowerPoint, OneNote, Access, Publisher, Visio, Project, and Codex, with project or file-name display.
  • Three Discord Apps Each lane connects under its own application ID, so lanes coexist as separate Discord cards instead of overwriting one another.
  • Browser Companion Optional MV3 extension supplies high-confidence hints for 14 web players over Chromium native messaging.
  • Hint Arbitration Browser hints are scored on playback state, tab visibility, confidence, and age, so a stale background tab cannot hijack the timeline.
  • Privacy Modes Per-lane Normal, App Only, and Private modes, plus a sensitive-keyword filter and a blocked app and site term list.
  • Detection Modes Choose whether a lane follows the foreground window, any visible window, or foreground with visible fallback.
  • Tray-First Workflow Single instance, close to tray, launch on startup, start minimized, and a global Rich Presence master toggle.
  • Diagnostics Export and import settings, inspect detection state, and enable source debug mode when a lane misbehaves.

Activity Lanes

The three lanes run independently. Each has its own detector, its own presence manager, and its own Discord application ID, and each can be disabled without affecting the others.

Lane Source Discord Card
Media Windows media sessions (GSMTC), optionally refined by browser hints Dedicated application
Creativity Adobe-family desktop windows Dedicated application
Productivity Office-family desktop windows and Codex Dedicated application

Detection Modes

The Creativity and Productivity lanes decide which app to report using one of three strategies.

Mode Behaviour
ForegroundPreferredVisibleFallback Default. Reports the focused app; falls back to any visible supported window when focus moves elsewhere.
ForegroundOnly Reports only the app you are actively focused on. Presence clears the moment you alt-tab away.
VisibleWindowOnly Reports any open supported window, whether or not it holds focus.

Privacy Modes

Mode What Discord sees
Normal App name plus the project or document name.
AppOnly App name only. File and project names are withheld.
Private A generic card. Neither the app nor the document is named.

Conflict & Idle Behaviour

When media and creative activity are live at once, CreativePriorityMode decides which wins: Auto, PreferMedia, or PreferCreative. When an app closes, CreativeIdleBehavior either holds the last card for five seconds (HoldLast5Seconds) or clears it at once (ClearImmediately), which avoids flicker when you are switching between documents.

Installation & Setup

Click the Download button above for the latest installer. Requires Windows 10 or 11 and the Discord desktop client, running. The web client does not expose the local IPC socket that Rich Presence needs.

Building from Source

Requires Visual Studio 2026 with the Desktop development for C++ workload, the MSVC v145 toolset, Node.js on PATH for the extension syntax checks, and Inno Setup 6 if you intend to produce the unpackaged installer.

Configuration Purpose
Debug / Release Standard development builds.
Release-Inno Unpackaged, self-contained build for Inno installer releases.
Release-MSIX Packaged MSIX build path.

The verification script restores NuGet packages, builds the solution, runs the extension's JavaScript syntax checks, executes the native guard tests, validates release artifacts, and performs a launch smoke test.

Verify a build
.\scripts\verify.ps1 -Configuration Debug -Platform x64

# Non-interactive runners have no desktop session for the launch smoke test
.\scripts\verify.ps1 -Configuration Debug -Platform x64 -SkipLaunchSmoke

# The MSIX path installs the package, launches it by identity, then uninstalls
.\scripts\verify.ps1 -Configuration Release-MSIX -Platform x64

Browser Extension & Hint Contract

Windows reports browser playback poorly: the timeline is often missing or stale. The optional MV3 extension fills that gap by reading the page directly and sending the desktop app a structured hint.

  1. Open chrome://extensions or edge://extensions and enable Developer mode.
  2. Click Load unpacked and select the browser-extension/ folder.
  3. Open the extension popup to choose whether hints are enabled and which sites may send them.
  4. Launch the desktop app once afterwards so it can refresh the per-user native-host registration.
Keep the extension key stable. Native messaging is bound to the fixed extension ID hodkjclfknpkaockiingkiijbbjekebj. Changing the committed key without also updating the app-side allow-list will silently break every hint.

Transport

The extension never talks to the app directly. It posts to a Chromium native-messaging host, which the app itself provides when launched with --browser-native-host; that host then forwards the payload into the running instance over a local named pipe. The app verifies the calling origin and the parent process before accepting anything, and it will not auto-launch if it is closed.

Channel Identifier
Native messaging host com.lastprojects.lastrichpresence
Named pipe \\.\pipe\LastRichPresence.BrowserHints
Accepted parents chrome.exe, msedge.exe
Max message size 64 KB

Hint Payload

Every tab reports its own hint. The background worker scores them and forwards only the winner, so a paused background tab cannot override the video you are actually watching. Playback state is worth the most, then tab visibility, then the scraper's own confidence, with older hints decaying.

Outbound hint · schemaVersion 1
{
  "schemaVersion": 1,
  "kind": "hint",
  "source": "lrp-browser-extension",
  "timestamp": 1749650412233,
  "data": {
    "service": "YouTube Music",
    "siteKey": "youtube_music",
    "mediaKind": "music",
    "title": "Time",
    "artist": "Hans Zimmer",
    "album": "Inception OST",
    "isPlaying": true,
    "positionSeconds": 191,
    "durationSeconds": 348,
    "pageHost": "music.youtube.com",
    "pageVisible": true,
    "tabId": 42,
    "sequence": 17,
    "confidence": 92,
    "rule": "media-session"
  }
}

When no tab qualifies, the extension sends { "kind": "clear" } instead, and the app falls back to whatever GSMTC reports on its own.

Supported Web Sources

Fourteen players ship with high-confidence scrapers: YouTube, YouTube Music, Spotify Web, SoundCloud, Apple Music, Amazon Music, Deezer, TIDAL, JioSaavn, Gaana, Wynk Music, Bandcamp, Mixcloud, and Twitch. Each can be toggled individually from the extension popup.

Architecture & Component Layout

Detection, presence building, and Discord IPC live in src/core/; the WinUI 3 shell, pages, and tray controller live in src/ui/. Each lane is a vertical slice (detector, presence manager, Discord application), and the browser chain feeds only the media lane. Click a node to jump to the section that documents it.

Browser Extension

MV3 · 14 web players

WinUI 3 Shell

MainWindow · pages · tray

Native Host

Named pipe bridge

MediaDetector

GSMTC + hint arbitration

CreativeDetector

Adobe-family windows

ProductiveDetector

Office-family windows

PresenceManager

Media card builder

CreativePresenceManager

Creativity card builder

ProductivePresenceManager

Productivity card builder

DiscordRPC

Local IPC · 3 application IDs

Source layout
Last Rich Presence/
├── src/
│   ├── core/                 # Detection, presence building, settings, Discord IPC
│   └── ui/                   # WinUI shell, pages, settings, tray, animations
├── browser-extension/        # Optional MV3 companion extension
├── installer/                # Inno Setup script and installer guide
├── scripts/                  # Build and verification scripts
├── tests/                    # Native guard tests
└── Assets/                   # Branding and curated fallback app logos

Settings & Persistence

Settings are stored in the WinRT ApplicationData local settings container, not a config file you edit by hand. Use the Settings page, or the diagnostics export and import if you want to move a configuration between machines.

Group Controls
General Rich Presence master toggle, close to tray, launch on startup, start minimized, tray left-click behaviour.
Media Timestamps, source label, paused state, album art, idle card, activity type override.
Privacy Sensitive keyword filter, strict browser privacy, browser album-art suppression, blocked app and site terms.
Creativity / Productivity Per-lane enable, detection mode, privacy mode, project-name display, per-app filters, activity type override.
Appearance Theme: FollowSystem, Light, or Dark.

Privacy & Network

The app is local-first, but two features reach the network and are worth knowing about before you enable them. Album-art fallback may query itunes.apple.com; if no direct artwork exists and only a thumbnail is available, the app can upload those image bytes to Imgur to obtain a hostable asset URL. Both are governed by the browser privacy and album-art settings, and turning album art off stops them entirely.

Troubleshooting & FAQ

The most common issues seen during install, build, and daily use.

Rich Presence is not updating at all
Confirm the Discord desktop client is running. Rich Presence is delivered over a local IPC socket that only the desktop client exposes, so it cannot work with Discord in a browser tab. Then check that the global Rich Presence toggle is on, and that the specific lane you expect is enabled.
Launching the app appears to do nothing
This is expected. The app is single-instance: a second launch redirects to the instance already running, which is most likely sitting in the tray. Check the notification area rather than launching again.
Browser hints never arrive
Native messaging binds to a fixed extension ID, so it is easy to break. Launch the desktop app at least once after installing or updating the extension so it can refresh the per-user host registration. Confirm hints are enabled in the extension popup and that the site itself is ticked. If you rebuilt the extension, make sure the committed key is unchanged: a new key means a new ID, and the app's allow-list will reject it. Note also that the extension will not launch the app for you; it must already be running.
The wrong tab is showing on Discord
Hints from every tab compete, and the winner is scored on playback state, tab visibility, scraper confidence, and age. A tab that is actually playing should always outrank a paused one. If a stale tab is winning anyway, close it or untick that site in the popup. Note also that hints older than the staleness window are discarded outright.
My Adobe or Office app is not detected
Check the lane's per-app filter first: individual apps can be switched off. Then check the detection mode: under ForegroundOnly the card clears as soon as the app loses focus, which is often mistaken for a detection failure. ForegroundPreferredVisibleFallback is the forgiving default.
Build fails with LNK1201 or LNK1104
The linker cannot overwrite the executable because a copy is still running, and because the app is tray-first, it is easy to miss. Exit it from the tray, then rebuild. Duplicate WindowsAppRuntimeAutoInitializer warnings during the build are known and harmless.
Launch-on-startup does not stick
For unpackaged installs the setting is a registry entry. Verify that HKCU\Software\Microsoft\Windows\CurrentVersion\Run\LastRichPresence exists and points at the installed executable.

Terms & License

Last Rich Presence is open source under the GNU General Public License v3.0. You may use, study, modify, and redistribute it, provided derivative works remain under the same license and the source stays available.

Adobe, Microsoft Office, Discord, and the streaming services named above are trademarks of their respective owners. This project is not affiliated with, endorsed by, or sponsored by any of them; app detection relies only on publicly visible window metadata.