README.md

Discord LSP Presence #

A Discord Rich Presence integration for the Helix editor via a standalone Language Server.

Overview #

This project enables Discord Rich Presence support in Helix by running a small Language Server that listens to editor events (opening/changing documents) and publishes the current editing context to Discord.

Since Helix doesn't support extensions, this LSP-based approach allows integration without modifying the editor itself.

Installation #

From Source #

git clone https://github.com/yourusername/discord-lsp-presence.git
cd discord-lsp-presence
cargo build --release

The binary will be at target/release/discord-lsp-presence.

Configuration #

Add to your Helix languages.toml:

[language-server.discord-presence]
command = "/path/to/discord-lsp-presence"

Then add the LSP to any language you want tracked:

[[language]]
name = "rust"
language-servers = ["rust-analyzer", "discord-presence"]

Optional Config File #

Create ~/.config/discord-presence-lsp/config.toml:

# Discord application ID (optional, uses default)
application_id = 123456789012345678

# Time tracking mode: "file" (default) or "workspace"
time_tracking = "workspace"

[activity]
details = "Working on {filename}"
state = "Project: {workspace}"
large_image_key = "helix"
large_image_text = "Helix Editor"

Available Options #

Field Type Default Description
application_id u64 1470506076574187745 Discord application ID
time_tracking "file" / "workspace" "file" Timer reset behavior
activity.details string "Editing: {filename}" Top line
activity.state string "in {workspace}" Bottom line
activity.large_image_key string none Large image asset
activity.large_image_text string none Large image text
activity.small_image_key string none Small image asset (language icon)
activity.small_image_text string none Small image text
activity.language_images bool true Show language icon as small image
activity.button_label string "View Repository" Button label (requires git remote)

Time Tracking #

  • file (default): Timer resets when switching files
  • workspace: Timer resets only when switching projects

Placeholders #

Use {filename}, {workspace}, {language}, and {editor} in text fields.

Features #

  • Automatic workspace detection via .git or .jj directory
  • Shows elapsed time in Discord
  • Configurable presence text
  • Language-specific icons
  • "View Repository" button (when git remote is detected)
  • Supports both Git and Jujutsu (JJ) repositories
  • No config file required

Limitations #

  • No idle detection
  • No did_close handling
  • Buttons are not visible to the user who set the presence (other users can see them)

Project-Level Configuration #

You can override global settings per-project by creating .discord-presence.toml in your project root (where .git or .jj lives). Project config merges with global config - project values override global ones.

Example #

Global config (~/.config/discord-presence-lsp/config.toml):

[activity]
details = "Editing: {filename}"
state = "in {workspace}"

Project config (.discord-presence.toml):

[activity]
details = "Working on {language}"
state = ""  # Override to show nothing

Unsetting Fields #

Set empty string to override a field with nothing. This works for all string fields:

Field Empty string value
state = "" Removes the state line
details = "" Removes the details line
button_label = "" Removes the repository button
large_image_key = "" Falls back to auto-detected editor icon
editor_image_text = "" Shows editor name (or nothing if also empty)
language_images = false Disables language icons per-project

License #

MIT