Dynamic Discord Rich Presence for Hyprland & Niri (Wayland). Automatically updates your Discord status based on the active window.
- Shows the current active window in Discord
- Supports any application (settings in
config.toml) - Lightweight and fast (Rust)
- Works on Hyprland & Niri (Wayland)
- NixOS and any arch-like distributive are supported
git clone https://github.com/kazuha046/discord-dynamic-status-wayland.git
cd discord-dynamic-status-wayland
cargo run --release[settings]
# Discord Application ID
# Get it from: Discord Developer Portal -> Applications -> Your App -> General Information
app_id = "1460605258072985705"
# Current Wayland compositor / window manager
# Supported values:
# - niri
# - hyprland
wm = "niri"
# Delay before updating Discord RPC after changing window
# Helps avoid too many RPC updates
update_delay = 3
# Default Rich Presence rule
# This rule is used when no application-specific rule matches
[default]
# Text shown as the first line of Discord Rich Presence
state = "Chilling"
# Text shown as the second line of Discord Rich Presence
details = "At the workspace"
# Large image displayed in Discord
# Supports templates:
# {pretty_os} - full OS name (example: "NixOS 26.11 (Zokor)")
# {os} - OS identifier (example: "nixos")
large_text = "{pretty_os}"
large_image = "{os}"
# Small image displayed in Discord
# {wm} will be replaced with current window manager name
small_text = "{wm}"
small_image = "{wm}"
# Application-specific Rich Presence rule
# Section name is used as the Discord asset name
# Example:
# [classes.ghostty] -> small_image = "ghostty"
#
# "match" is the real Wayland application class
# You can find it using tools like:
# - `niri msg windows`
# - `hyprctl clients`
[classes.ghostty]
# Wayland class used to detect the application.
# By default, it uses the section name (`classes."name"`).
match = "com.mitchellh.ghostty"
# Custom Rich Presence for Ghostty
state = "At ghostty"
details = "Writing command lines"
# You can also override another default settings
# If a setting is not specified here, the value from the default section will be used
small_text = "Ghostty with Fish"
# Example:
[classes.code]
state = "At VSCode"
details = "Developing some programs"
small_text = "VSCode"Important: use your Application ID from Discord Developer Portal, not a bot token.
- I have also already added all images in the current default config using my App ID
git clone https://github.com/kazuha046/discord-dynamic-status-wayland.git
cd discord-dynamic-status-waylandcargo build --releasecp target/release/discord-dynamic-status-wayland ~/.local/bin/
chmod +x ~/.local/bin/discord-dynamic-status-waylanddiscord-dynamic-status-wayland Use
yay -S dynamic-drpc-wayland-binoryay -S dynamic-drpc-wayland-gitand you can add the program to startup in Niri / Hyprland
Using flake with home-manager
{
inputs = {
dynamic-drpc-wayland = {
url = "github:kazuha046/discord-dynamic-status-wayland";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}Make sure your home-manager configuration receives flake inputs:
{
home-manager = {
users.your-user = import ./home.nix;
extraSpecialArgs = {
inherit inputs;
};
};
}{
imports = [
inputs.dynamic-drpc-wayland.homeManagerModules.default
];
}{
services.dynamic-drpc-wayland = {
enable = true;
};
}sudo nixos-rebuild switch --flake /etc/nixos/#your-hostThe service will be started automatically through
systemd --user.
The service generates
~/.config/dynamic-drpc-wayland/config.toml
You can configure default status and application rules: Go to Settings
{
services.dynamic-drpc-wayland = {
enable = true;
settings = {
app_id = "YOUR_APP_ID";
wm = "niri";
update_delay = 3;
};
default = {
state = "Chilling";
details = "At the workspace";
large_text = "{pretty_os}";
large_image = "{os}";
};
classes = {
ghostty = {
match = "com.mitchellh.ghostty";
state = "At ghostty";
details = "Writing command lines";
small_text = "Ghostty with Fish";
};
code = {
state = "At VSCode";
details = "Developing some programs";
small_text = "VSCode";
};
};
};
}- Discord must be online and not in Invisible mode
- All assets in
config.tomlmust exist in Discord Developer Portal โ Art Assets - Of course, you should have an internet connection :)
MIT License โ see LICENSE