glzr-io / zebar

Zebar is a tool for creating customizable and cross-platform taskbars, desktop widgets, and popups.
GNU General Public License v3.0
161 stars 13 forks source link

Changing GlazeWM active workspace doesn't update Zebar component #30

Closed matthewtapps closed 4 months ago

matthewtapps commented 4 months ago

When using the GlazeWM provider in Zebar with the following config:

template/glazewm:
      styles: |
        display: flex;
        align-items: center;

        .workspace {
          width: 20px;
          height: 26px;
          background: transparent;
          border: none;
          margin-left: 2px;
          margin-right: 2px;
          color: #d5c4a1;
        }

        .workspace.active {
          color: #689d6A;
        }
      providers: ['glazewm']
      template: |
        <div class="component">
          @for (workspace of glazewm.workspacesOnMonitor) {
            <button class="workspace{{ workspace.focusIndex ? "" : " active" }}">{{ workspace.name }}</button>
          }
        </div>

The active workspace as styled by workspace.focusIndex doesn't appear to update as the active workspace in Glaze changes.

Navigating to a new workspace (that doesn't exist prior to navigating to it) correctly updates the bar and active workspace, as does navigating off of this workspace to another workspace - creating/deleting workspaces appears to trigger an update where navigating between existing workspaces does not.