Skip to content

feat(mpris): pin preferred media source - #3150

Open
scottsteely wants to merge 2 commits into
AvengeMedia:masterfrom
scottsteely:master
Open

feat(mpris): pin preferred media source#3150
scottsteely wants to merge 2 commits into
AvengeMedia:masterfrom
scottsteely:master

Conversation

@scottsteely

Copy link
Copy Markdown
Screenshot example

Description

Add a minimal "pin media source" option so the bar media widget and OSD keep showing a preferred player (e.g. a music player) even when another source (e.g. YouTube in the browser) starts playing.

  • MprisController: new pinnedIdentity property + setPinned(identity); _bestPlayingPlayer() prefers a playing pinned player (exact identity match, then case-insensitive substring fallback). Existing behavior is unchanged when no pin is set.
  • Persistence via SessionData.pinnedPlayerIdentity (spec entry added so SessionData.set() accepts the key); empty string clears the pin.
  • MediaDropdownOverlay (Media Players panel): each player row gets a theme-colored circle indicator on the right. Empty circle = no pin (initial state). Right-click a row to make it the default source (circle fills); right-click another row to move the pin; right-click the pinned row again to clear (back to empty). Left-click behavior unchanged (selects the player).

Type of change

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

Related issues

Screenshots / video

Screenshot example

Checklist

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

Add a minimal "pin media source" option so the bar media widget and OSD
keep showing a preferred player (e.g. a music player) even when another
source (e.g. YouTube in the browser) starts playing.
 - MprisController: new pinnedIdentity property + setPinned(identity);
  _bestPlayingPlayer() prefers a playing pinned player (exact identity
  match, then case-insensitive substring fallback). Existing behavior
  is unchanged when no pin is set.
- Persistence via SessionData.pinnedPlayerIdentity (spec entry added so
  SessionData.set() accepts the key); empty string clears the pin.
- MediaDropdownOverlay (Media Players panel): each player row gets a
  theme-colored circle indicator on the right. Empty circle = no pin
  (initial state). Right-click a row to make it the default source
  (circle fills); right-click another row to move the pin; right-click
  the pinned row again to clear (back to empty). Left-click behavior
  unchanged (selects the player).
@hthienloc

Copy link
Copy Markdown
Member

/claude review

Comment thread quickshell/Services/MprisController.qml
@claude

claude Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Claude review

One minor issue; the feature itself looks sound and existing selection behavior is preserved when no pin is set.

  • setPinned() imperatively assigns pinnedIdentity, destroying its binding to SessionData.pinnedPlayerIdentity (redundant, since SessionData.set() already propagates) — quickshell/Services/MprisController.qml:313

Checked: pin resolution order in _bestPlayingPlayer(), SessionData spec/persistence round-trip, delegate layout and right-click handling in MediaDropdownOverlay (no new user-facing strings, en.json/template.json untouched, no Go changes). Model: claude-opus-5.

Concur with Claude's suggestion.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants