Skip to content

dock: add per-window icons with title memory - #4195

Open
rollecode wants to merge 1 commit into
duxlabs-dev:masterfrom
rollecode:feat/dock-icon-overrides
Open

rollecode wants to merge 1 commit into
duxlabs-dev:masterfrom
rollecode:feat/dock-icon-overrides

Conversation

@rollecode

@rollecode rollecode commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

When I have many terminals open they all look the same in the dock, see the screenshot below. This adds "Change Icon" to the right click menu of a single window. It opens the file browser and the picked image (png, svg, jpg, webp) replaces the dock icon of that window until the window closes.

"Remember Icon" saves the icon for that app and window title, so a new window with the same title gets it back. Leading spinner and status characters in the title are ignored, Claude Code and some other tools prefix titles with those. "Reset Icon" goes back to the app's own icon.

Remembered icons are stored in session.json as dockIconRules.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Screenshot

No icons set yet, the new "Change Icon" item in the menu:

Dock right click menu with Change Icon over identical foot terminal icons

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dux-docs to document any new behaviors: https://github.com/duxlabs-dev/dux-docs

Added quickshell/tests/dock-icon-rules.test.mjs for the title matching. Tested on driftwm on top of v2.1.0, which is my installed version. The branch itself is on current master.

The code was written with Claude Code, tested by me.

@github-actions github-actions Bot added feature ui Quickshell UI under quickshell/ labels Nov 7, 2026
@bbedward

bbedward commented Nov 8, 2026

Copy link
Copy Markdown
Member

/claude review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude review

Looks good overall; one memory issue to fix.

  • Picker window is created eagerly in a dock-loaded singleton, so it stays in memory for the whole session; lazy-load it, quickshell/Services/DockIconService.qml:19
    Checked: DockIconRules title matching and regex, binding dependencies in DockAppButton and DockContextMenu, toplevel pruning, SessionData/SessionSpec persistence, FileBrowserModal accept/reject flow, I18n strings, imports, deprecated shims. Model: claude-opus-5-5.

property string pendingAppId: ""
property var pendingToplevel: null

FileBrowserModal {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileBrowserModal is a FloatingWindow. Every DockAppButton reads DockIconService.iconFor, so this singleton gets built as soon as the dock loads. That means a hidden window object (plus its WindowBlur) stays in memory for the whole session, even though the picker is used rarely. Other long-lived hosts, like SettingsModal and NetworkVpnTab, wrap the browser in a Loader/LazyLoader with active: false. Do the same here: set active = true in chooseImage() and call open() on the loaded item. Optionally set it back to inactive after accepted/rejected.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ui Quickshell UI under quickshell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants