Skip to main content

discern-discord

disc(ord) + discern — distinguishes your Discord notifications by type.

Colored tray indicator for Discord on Linux.

Color Meaning
Red DM, @mention, @everyone, @here
Blue Generic channel message
Grey Nothing unread

Resets to grey automatically when you open Discord and read your messages.

Install

From source (any distro)

git clone https://github.com/polpanka/discern-discord.git
cd discern-discord
bash install.sh

The script detects your package manager (apt/dnf/pacman/zypper) and installs dependencies automatically.

From PyPI

pip install discern-discord

Note: dbus-python and PyGObject require system libraries. If pip fails, install them via your package manager first (see Dependencies).

From AUR (Arch/Manjaro)

yay -S discern-discord

Configuration

Edit ~/.config/discern-discord/settings.json:

{
  "discord_username": "Paolo",
  "mention_keywords": ["urgente", "importante"]
}
  • discord_username — your Discord display name, to detect @Paolo in channel messages
  • mention_keywords — extra words that trigger the red indicator (case-insensitive)

Usage

# Run directly
discern-discord

# Or as a systemd user service
systemctl --user enable --now discern-discord

Test notifications

discern-discord &
python3 test/send_test_notification.py dm        # → red
python3 test/send_test_notification.py generic    # → blue
python3 test/send_test_notification.py mention    # → red
python3 test/send_test_notification.py clear      # → grey

How it works

Discord (Electron)
    │
    │  org.freedesktop.Notifications.Notify
    ▼
D-Bus session bus ◄── discern-discord (eavesdrop / dbus-monitor fallback)
    │
    ├── title has no "#"?        → DM (red)
    ├── body has @you/@everyone? → mention (red)
    └── otherwise                → generic (blue)

Auto-reset when you read messages:

  1. LauncherEntry D-Bus — Discord signals count-visible: false when its badge clears
  2. Window focus — if Discord is focused for 3+ seconds (uses xdotool or xprop, optional)
  3. Manual — right-click tray icon → Clear

Dependencies

Ubuntu/Debian Fedora Arch openSUSE
D-Bus Python python3-dbus python3-dbus python-dbus python3-dbus-python
PyGObject python3-gi python3-gobject python-gobject python3-gobject
AppIndicator gir1.2-ayatanaappindicator3-0.1 libayatana-appindicator-gtk3 libayatana-appindicator typelib-1_0-AyatanaAppIndicator3-0_1
xdotool or xprop (optional) xdotool xdotool xdotool xdotool

Uninstall

bash uninstall.sh
# or
pip uninstall discern-discord

License

MIT

Metadata

Release files for discern-discord 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discern-discord 0.2.0
File Size Uploaded Provenance Actions
discern_discord-0.2.0.tar.gz 9.8 kB Without provenance Details for discern_discord-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for discern-discord 0.2.0
File Interpreter ABI Platform Actions
discern_discord-0.2.0-py3-none-any.whl Python 3 none any Details for discern_discord-0.2.0-py3-none-any.whl

Total release size: 19.7 kB

Release files / discern_discord-0.2.0.tar.gz

Download URL discern_discord-0.2.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
193689e37969f15bd750bc54922bfeab24dab3d5b76c4fd31c66eeafb164e862
BLAKE2b-256 checksum
How to use checksums
f4f627b06ad5c01ab73e3b73fa9b8def45781ad9e190d992c9e879d82624013d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / discern_discord-0.2.0-py3-none-any.whl

Download URL discern_discord-0.2.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5b6a04e93acbab32455b26aad55b7531c446e0eca15e67d66efd573f92d6b5e
BLAKE2b-256 checksum
How to use checksums
870acc8630a81369d50856aa412ae66a41de7c2a1cb80a7e7f2a4255cc506729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for discern-discord 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page