Skip to content

MPRIS metadata containing newline characters (\n) causes Waybar to expand to multiple lines #4971

@aloispichler

Description

@aloispichler

Description:
In the mpris module, metadata provided via MPRIS may contain newline characters (\n). When such metadata is displayed (e.g., via {dynamic}, {title}, or `{artist}), Waybar renders these newline characters as hard line breaks.

This causes the module—and consequently the bar—to expand to multiple lines, breaking the layout.

Expected behavior:
Waybar should either:

ignore newline characters in MPRIS metadata, or
provide an option to sanitize/replace them (e.g., convert \n to spaces)

Actual behavior:
If the metadata contains newline characters, the text is rendered across multiple lines, increasing the bar height.

Suggested solution:
Add an option to sanitize MPRIS strings (e.g., strip or replace \n), or handle them internally by default.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions