AvengeMedia / AvengeMedia/DankMaterialShell
Launcher source badge shows Snap for Nix apps that carry BAMF_DESKTOP_FILE_HINT
- Dominant language
- QML
- Stars
- 8.1k
- Forks
- 515
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 102
Description
### Compositor
Niri
### Distribution
NixOS
### Installation Method
Source
### dms doctor -vC
Click to expand
```
System Health Check
──────────────────────────────────────
System
● Operating System ····· NixOS 26.11 (Zokor)
└─ Supported for runtime (install via NixOS module or Flake)
● Architecture ········· amd64
● Display Server ······· Wayland
└─ WAYLAND_DISPLAY=wayland-1
Versions
● DMS CLI ·············· dms 1.7-beta+date=2026-09-10_4d5bac2
└─ /nix/store/4a3j4qhygky2682lg28pm0kaz2mb3ihw-dms-shell-1.7-beta+date=2026-09-10_4d5bac2/bin/.dms-wrapped
● Quickshell ··········· Quickshell 0.3.1 (revision tag-v0.3.1, distributed by Nixpkgs)
└─ /etc/profiles/per-user/mooling/bin/qs
● DMS Shell ············ 1.7-beta+date=2026-09-10_4d5bac2
└─ /nix/store/4a3j4qhygky2682lg28pm0kaz2mb3ihw-dms-shell-1.7-beta+date=2026-09-10_4d5bac2/share/quickshell/dms
Installation
● DMS Configuration ···· Found
└─ /nix/store/4a3j4qhygky2682lg28pm0kaz2mb3ihw-dms-shell-1.7-beta+date=2026-09-10_4d5bac2/share/quickshell/dms
● shell.qml ············ Present
└─ /nix/store/4a3j4qhygky2682lg28pm0kaz2mb3ihw-dms-shell-1.7-beta+date=2026-09-10_4d5bac2/share/quickshell/dms/shell.qml
○ Install Type ········· Nix store
└─ /nix/store/4a3j4qhygky2682lg28pm0kaz2mb3ihw-dms-shell-1.7-beta+date=2026-09-10_4d5bac2/share/quickshell/dms
Compositor
● niri ················· 26.04
└─ /run/current-system/sw/bin/niri
○ Active ··············· niri
● Background Blur ······ Supported
└─ Compositor supports ext-background-effect-v1
Quickshell Features
● Polkit ··············· Available
└─ Authentication prompts
● IdleMonitor ·········· Available
└─ Idle detection
● IdleInhibitor ········ Available
└─ Prevent idle/sleep
● ShortcutInhibitor ···· Available
└─ Allow shortcut management (niri)
● BackgroundBlur ······· Available
└─ Background blur API support in Quickshell
Optional Features
● accountsservice ······ Available
└─ User accounts
● power-profiles-daemon Available
└─ Power profile management
● logind ··············· Available
└─ Session management
● cups-pk-helper ······· Available
└─ Printer management
○ I2C/DDC ·············· No monitors detected
└─ External monitor brightness control
● qt6-imageformats ····· Installed (4 formats)
└─ Formats: WebP, TIFF, JP2, ICNS (/nix/store/kag5qb204z8npfbkiy1w84z49d3n99v7-qtimageformats-6.11.2/lib/qt-6/plugins/imageformats)
● kimageformats ········ Installed (4 formats)
└─ Formats: AVIF, HEIF, JXL, EXR (/nix/store/cg79ihxkh164b57zm1h9ray22sqpy346-kimageformats-6.30.0/lib/qt-6/plugins/imageformats)
● Terminal ············· ghostty, kitty, alacritty
● Network ·············· NetworkManager
└─ NetworkManager present. Using NM API.
● matugen ·············· Installed
└─ Dynamic theming
● cava ················· Installed
└─ Audio visualizer
● khal ················· Installed
└─ Calendar events
● danksearch ··········· Installed
└─ File search
● dankcalendar ········· Installed
└─ Calendar app
○ fprintd ·············· Not installed
└─ Fingerprint auth
● adw-gtk3 ············· Installed
└─ GTK3 dynamic theming (user copy)
Config Files
● settings.json ········ Present
└─ /home/mooling/.config/DankMaterialShell/settings.json
● clsettings.json ······ Present
└─ /home/mooling/.config/DankMaterialShell/clsettings.json
● plugin_settings.json · Present
└─ /home/mooling/.config/DankMaterialShell/plugin_settings.json
● session.json ········· Present
└─ /home/mooling/.local/state/DankMaterialShell/session.json
● dms-colors.json ······ Present
└─ /home/mooling/.cache/DankMaterialShell/dms-colors.json
Services
○ dms.service ·········· Not installed
└─ Optional user service
● greetd ··············· enabled
Environment
○ QT_QPA_PLATFORMTHEME · qt5ct
○ qt5ct plugin (Qt5) ··· Cannot verify (no qmake/qtpaths)
└─ Install a Qt development package to let dms doctor check the plugin against the path Qt actually searches.
○ QT_QPA_PLATFORMTHEME… qt6ct
○ qt6ct plugin (Qt6) ··· Cannot verify (no qmake/qtpaths)
└─ Install a Qt development package to let dms doctor check the plugin against the path Qt actually searches.
○ QS_ICON_THEME ········ Not set
○ XDG_MENU_PREFIX ······ Not set
Fonts
● Normal Font ·········· 更纱黑体 UI SC
└─ Available via fontconfig
● Monospace Font ······· Maple Mono NF CN
└─ Available via fontconfig
──────────────────────────────────────
✓ All checks passed!
```
### Description
The launcher's trailing package-source badge shows the **Snapcraft glyph** for an application that is not installed via Snap.
`classifyAppSource()` in `quickshell/Modals/DankLauncherV2/ControllerUtils.js` treats *any* `Exec` line containing `BAMF_DESKTOP_FILE_HINT=` as a Snap app:
```js
if (cmd0 === "snap"
|| exec.indexOf("bamf_desktop_file_hint=") !== -1
|| exec.indexOf("/snap/bin/") !== -1
|| exec.indexOf("/snap/core") !== -1
|| exec.indexOf("snap run ") === 0)
return "snap";
if (exec.indexOf("/nix/store/") !== -1
|| exec.indexOf("/run/current-system/sw/") !== -1
|| exec.indexOf("/etc/profiles/per-user/") !== -1)
return "nix";
```
Two problems:
1. `BAMF_DESKTOP_FILE_HINT` is not a Snap marker. It comes from the BAMF window-matching framework and is set by other packagers too (Plasma reads it for desktop-file resolution in notifications). snapd has already removed it as legacy — canonical/snapd#15798, "snap: Drop legacy BAMF_DESKTOP_FILE_HINT in desktop files". The heuristic therefore keys off a variable Snap no longer emits, while still matching non-Snap apps that do.
2. The `snap` branch returns before the `nix` branch, so a package living in `/nix/store` can never reach the correct classification.
Concrete case on this machine: `codex-desktop` (repack of the official .deb, from [`github:ilysenko/codex-desktop-linux`](https://github.com/ilysenko/codex-desktop-linux)) installs into `/nix/store/r2crlpn6…-codex-desktop-26.903.71938/`, and its desktop entry reads:
```
Exec=env BAMF_DESKTOP_FILE_HINT=/nix/store/r2crlpn6…/share/applications/codex-desktop.desktop \
CHROME_DESKTOP=codex-desktop.desktop \
/nix/store/r2crlpn6…/bin/codex-desktop %u
```
Its launcher row renders `assets/package-sources/snap.svg` (#E95420) instead of the Nix snowflake. In the very same list, `Google Chrome` — whose desktop entry is a plain `/nix/store/...` Exec with no BAMF variable — correctly shows the Nix badge.
### Expected Behavior
Classification should follow where the app actually comes from. `BAMF_DESKTOP_FILE_HINT=` alone should not imply Snap; `cmd0 === "snap"`, `/snap/bin/`, `/snap/core*` and a leading `snap run ` are sufficient — and if a stronger signal is wanted, snapd's own `X-SnapInstanceName` / `X-SnapAppName` desktop keys are better candidates.
### Steps to Reproduce
1. Install any app whose desktop `Exec` contains `BAMF_DESKTOP_FILE_HINT=` but whose binary lives outside Snap.
2. Open the app drawer (`Super+Space`, mode `apps`).
3. Inspect the trailing badge of that row: it shows the orange Snapcraft glyph instead of the real source.
### Error Messages/Logs
None — display-only misclassification, nothing is logged.
### Screenshots/Recordings
Attached: top row `Google Chrome` shows the correct Nix snowflake; bottom row `ChatGPT Community` (the `Name=` of `codex-desktop.desktop`) shows the Snapcraft badge, although it is a Nix package just like Chrome.
### Suggested fix
Drop the `bamf_desktop_file_hint=` substring test, or run the `/nix/store/` / profile-path tests before the `snap` test.
Contributor guide
Research direction
Start in quickshell/Modals/DankLauncherV2/ControllerUtils.js at classifyAppSource() and compare the existing Snap and Nix path checks with the reported codex-desktop Exec line. Done means BAMF_DESKTOP_FILE_HINT-only applications use their actual package source, while the listed Snap markers still receive the Snap badge and Nix paths receive the Nix badge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nixos
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100