Skip to content

Conversation

@EmilBerbakov
Copy link
Contributor

@EmilBerbakov EmilBerbakov commented Nov 10, 2025

Implements the request asked for here (Widget)-GlazeWM-Workspaces - Add an Optional Distinction Between an Active Workspace and a Focused Workspace.

This PR adds the following:

Widget Code

  • added two new statuses: FOCUSED_EMPTY and FOCUSED_POPULATED
  • added a refresh_widget_style call for the text_label of GlazewmWorkspaceButtonWithIcons
    • this allows the ability to add targeted, status-specific styling to the .label class of the button when app icons are enabled

yaml options:

  • focused_populated_label and focused_empty_label
    • These function like their active counterparts. If not set, they will take on the values of their active counterparts to maintain current functionality
  • enabled_focused
    • This enables app icons for focused workspaces. It is nullable, and if not set, takes on the value of active_focused to maintain current functionality

CSS customization:

  • focused_populated and focused_empty
    • Whenever a workspace is determined to be FOCUSED_POPULATED or FOCUSED_EMPTY, both the relevant active class is applied, followed by the relevant focused class. This allows for CSS customization for focused statuses to be entirely optional, and all previous stylings will be unaffected.
      • This also means that, in order to opt in, one must define the focused styles after their respective active stylings. This quirk has been added to the documentation

Copy link
Contributor

@Video-Nomad Video-Nomad left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! The code looks good to me, and I can't find any issues with the styling or backwards compatibility. Without changing anything my old config looks the same and the new stuff works too if I add it 👍

Just a small note (for myself mostly not related to this PR): there is a small styling bug with icons enabled and empty (not active) workspaces not having the correct style from .glazewm-workspaces .ws-btn.empty. In GlazeWM workspaces should be set to keep_alive: true. If you want to check this out and fix it in this PR that would be great but it's fine to leave that, I can fix it later.

Another note on commit history - please clean it up a bit. It's fine to have multiple commits in a PR but please check other commits and how they are written and styled. Maybe rebase and squash some of them if they are redundant.

@EmilBerbakov EmilBerbakov force-pushed the feature/glazewm-workspaces-distinguish-between-active-and-focused branch from 5764fe4 to 6301c3f Compare November 10, 2025 23:07
…space

Change _update_status for so that status logic switching does not catch on cases where they should evaluate to EMPTY and instead eval to FOCUSED_EMPTY
Add focused states to _animate_buttons
@EmilBerbakov EmilBerbakov force-pushed the feature/glazewm-workspaces-distinguish-between-active-and-focused branch from 6301c3f to 8b45c76 Compare November 10, 2025 23:27
@EmilBerbakov
Copy link
Contributor Author

I have updated the commit history to be a lot cleaner.

For the empty styling, are you saying that a note needs to be added to the documentation on how a workspace needs to have keep_alive set to true if they want the empty styling to be applied to said workspace, or are you saying there's a way to dynamically set that property for a workspace through a command?

@Video-Nomad
Copy link
Contributor

Video-Nomad commented Nov 11, 2025

Sorry, nevemind, it was my mistake with the styling. Just re-tested it again and it works as expected. .glazewm-workspaces .ws-btn.empty should be .glazewm-workspaces .ws-btn.empty .label for when the icons are enabled. Forgot this detail.

So, this PR is good to go then, at least on my end. I can't merge stuff so it's up to @amnweb.

@amnweb amnweb merged commit ab13570 into amnweb:main Nov 14, 2025
5 of 6 checks passed
@EmilBerbakov EmilBerbakov deleted the feature/glazewm-workspaces-distinguish-between-active-and-focused branch November 14, 2025 18:51
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.

3 participants