Skip to content

feat(widgets/workspaces): Add "ID and Name" option for label source - #4165

Open
BBaoVanC wants to merge 1 commit into
noctalia-dev:mainfrom
BBaoVanC:show-number-on-named-workspaces
Open

feat(widgets/workspaces): Add "ID and Name" option for label source#4165
BBaoVanC wants to merge 1 commit into
noctalia-dev:mainfrom
BBaoVanC:show-number-on-named-workspaces

Conversation

@BBaoVanC

@BBaoVanC BBaoVanC commented Aug 30, 2026

Copy link
Copy Markdown

Summary

This adds an "id_and_name" option to the label_source option on the workspaces widget, which displays both the numerical ID of the workspace and its name, if an explicit name is given. There is also a label_separator option which lets you configure what is placed in between the workspace ID and name (defaults to a single space).

Motivation

This is useful if you use named workspaces (i.e. in Niri), but still want to be able to easily see what number to press to go to that exact workspace, simply by looking at the bar.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Testing

  1. In config, set widget.workspaces.label_source to id_and_name, and optionally set label_separator to whatever you want.
  2. Rename some workspaces
  3. Observe the named ones show both the index and name, while unnamed ones just show the index alone.

I have also checked the settings UI to confirm that the option shows up correctly and is configurable.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

Image demonstrates having label_separator set to ":".

image

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior. I updated the docs directly in this PR after rebasing
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

I'm not quite sure how the config defaults are supposed to work. I want the label_separator to default to a single space, but it seems like it still is just defaulting to an empty string. Apart from that I don't see any issues. Figured it out, I had accidentally forgotten to change it under the Options struct.

@BBaoVanC
BBaoVanC force-pushed the show-number-on-named-workspaces branch from bbcbc3c to c0b2049 Compare August 31, 2026 01:05
This adds an "id_and_name" option to the label_source option on the
workspaces widget, which displays both the numerical ID of the workspace
and its name, if an explicit name is given. There is also a
label_separator option which lets you configure what is placed in
between the workspace ID and name.

This is useful if you use named workspaces (i.e. in Niri), but still
want to be able to easily see what number to press to go to that exact
workspace, simply by looking at the bar.
@BBaoVanC
BBaoVanC force-pushed the show-number-on-named-workspaces branch from c0b2049 to fb06db1 Compare August 31, 2026 01:07
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.

1 participant