Skip to content

About

App launcher keys that follow your icon theme and show unread-count badges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App Badges for OpenDeck

Stream Deck keys with app icons and red unread badges

An OpenDeck plugin for Linux. It adds one key type, App with badge: the key shows an app's icon, opens the app when pressed, and draws a red unread badge in the top-right corner, the same count your taskbar shows.

Works with any app that publishes a launcher badge count. Telegram and Discord are confirmed, and so are most Qt and Electron chat apps. Apps that don't publish one show just their icon, so the key is still a normal launcher.

Also a themed app launcher. You can use it for any installed app, badge or not: Flatpak, system or your own .desktop entries. The key icon comes from your currently selected icon theme, so your deck matches your desktop. Switch icon themes and the keys follow (within a minute), with no icon files to hunt down or set per key.

How it works

  • Counts: apps announce unread counts with the com.canonical.Unity.LauncherEntry Update D-Bus signal (the same one KDE Plasma's task manager uses for its badges). The plugin listens with dbus-monitor.

  • Saved counts: apps only send a count when it changes, so the last known counts are saved to ~/.cache/opendeck-appbadges.json. Keys show the right badge again straight after a restart.

  • Icons: looked up from the app's .desktop entry, in your current icon theme first, then hicolor and pixmaps. The theme comes from ~/.config/kdeglobals on KDE, and from gsettings or GTK's settings.ini on GNOME and other desktops. You can set a custom icon per key.

  • Key image: an SVG made of the icon plus a pill-shaped badge. It shows 99+ above 99 and is hidden at zero.

  • Launching: gtk-launch <desktop-id>.

  • Press: bring the app's window to the front. If the app has several windows, repeated presses cycle through them. Minimized windows are restored, and windows on another virtual desktop are followed there. If the app isn't running, it's launched.

  • Hold (half a second): open a new window. This uses the app's own "new window" action when its desktop entry has one (Firefox, Chrome, VS Code, Konsole, …); otherwise it's a normal launch. If the app isn't running, it's launched.

    Window handling uses KWin's D-Bus API (/WindowsRunner and getWindowInfo), so it needs KDE Plasma. On other desktops the key simply launches the app. Windows are matched to the app by desktop entry name, window class, binary or Flatpak command.

  • No dependencies: plain Node.js, using its built-in WebSocket (Node 22 or newer).

Requirements

  • Linux with a session D-Bus. Works on any desktop; tested on KDE Plasma 6 (Wayland). Some apps only send badge counts when a badge-aware dock is running, such as KDE's task manager, GNOME's Dash to Dock or the Ubuntu Dock.
  • Node.js 22+ on the host.
  • dbus-monitor and gtk-launch (packages dbus-bin and libgtk-3-bin on Debian/Ubuntu).

Install

Copy or clone this folder into OpenDeck's plugins folder, keeping the folder name io.github.cptsoviet.appbadges.sdPlugin, then restart OpenDeck:

  • Native OpenDeck: ~/.config/opendeck/plugins/
  • Flatpak OpenDeck: ~/.var/app/me.amankhanna.opendeck/config/opendeck/plugins/

For example, for Flatpak OpenDeck:

git clone https://github.com/cptsoviet/opendeck-appbadges.git \
  ~/.var/app/me.amankhanna.opendeck/config/opendeck/plugins/io.github.cptsoviet.appbadges.sdPlugin

Flatpak OpenDeck

The plugin must run outside the sandbox to hear other apps' D-Bus signals, read their icons and launch them. start.sh runs $NODE_BIN (default: node), so point NODE_BIN at a small wrapper that runs the host's Node:

mkdir -p ~/.var/app/me.amankhanna.opendeck/data/bin
cat > ~/.var/app/me.amankhanna.opendeck/data/bin/node-host <<'EOF'
#!/bin/sh
exec flatpak-spawn --host --watch-bus /usr/bin/node "$@"
EOF
chmod +x ~/.var/app/me.amankhanna.opendeck/data/bin/node-host
flatpak override --user --talk-name=org.freedesktop.Flatpak \
  --env=NODE_BIN=$HOME/.var/app/me.amankhanna.opendeck/data/bin/node-host \
  me.amankhanna.opendeck

Use

  1. Drag App Badges → App with badge onto a key.
  2. Pick the app in the key's settings. Optionally, give a custom icon path.
  3. Leave the key title empty, so OpenDeck doesn't draw text over the icon.

Notes

  • If a badge never appears, check whether the app sends counts: dbus-monitor --session "interface='com.canonical.Unity.LauncherEntry'", then read a message.
  • Log: OpenDeck's plugin log, io.github.cptsoviet.appbadges.sdPlugin.log.

License

MIT, see LICENSE.

About

App launcher keys that follow your icon theme and show unread-count badges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages