Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Window Title provider #80

Open
aleDsz opened this issue Aug 11, 2024 · 3 comments · May be fixed by #157
Open

[Feature Request] Window Title provider #80

aleDsz opened this issue Aug 11, 2024 · 3 comments · May be fixed by #157
Assignees
Labels
help wanted Extra attention is needed type: feature New feature or request

Comments

@aleDsz
Copy link

aleDsz commented Aug 11, 2024

Describe the problem/motivation

Request to add support for reading the current open window title.

Describe the solution you'd like

I've used GlazeWM v2 to show in the middle of the bar the current open window title, so I can see what window is being focused. Would be nice to have this back and allow the provider to have a variable controlling the max length of the title.

Alternatives considered

No response

Additional context

No response

@aleDsz aleDsz added the type: feature New feature or request label Aug 11, 2024
@github-project-automation github-project-automation bot moved this to 📬 Needs triage in zebar Aug 11, 2024
@monoelh
Copy link

monoelh commented Aug 12, 2024

There was an example in the glazewm/zebar discord. Always recommended to check there first. Unfortunately, some user reported, that it doesn't work, but this config for the center group works fine:

group/center:
    styles: |
      justify-self: center;
      display: flex;
    template/glazewm_other:
      providers: ['glazewm']
      template: |
        {{glazewm.focusedContainer.title}}

You should be able to style the appearance to your liking. This is also just a minimal solution and some functionality is missing:

  • shows active window from different workspace in multi monitor setting
  • it doesn't update the title when switching tabs in apps like Edge or notepad(++)

P.S.:
The snipped from discord looks like:

template/glazewm_current_window:
      providers: ['glazewm', 'date']
      styles: |
        .current-window {
          color: white;
          white-space: nowrap;
          max-width: 300px;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .time {
          color: #bac2de;
        }
      template: |
        @if (glazewm.focusedContainer?.type === 'window') {
          <span class="current-window">
            {{ glazewm.focusedContainer.title.length > 80 ? glazewm.focusedContainer.title.slice(0, 80) + '...' : glazewm.focusedContainer.title }}
          </span>
        } @else {
          <span class="time">
            {{ date.toFormat(date.now, 'EEE    d MMM t') }}
          </span>
        }

@lars-berger lars-berger moved this from 📬 Needs triage to 📋 Available in zebar Aug 15, 2024
@lars-berger lars-berger added the help wanted Extra attention is needed label Aug 15, 2024
@DreamMaoMao
Copy link
Contributor

However, this does not automatically update the window title, it only triggers the update when glazewm does some action (switch focus, full screen trigger).

@DreamMaoMao
Copy link
Contributor

refer to
#97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type: feature New feature or request
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

5 participants