Code Monkey home page Code Monkey logo

zebar's People

Contributors

ashwinjadhav818 avatar ctbyte avatar lars-berger avatar lgug2z avatar matthewtapps avatar thearturca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zebar's Issues

[3.1.0] 'glazewm' provider does not work for unknown reason.

When I add 'glazewm' as an adapter, I get this very descriptive error message.
image

Offending lines of config:

template/glazewm:
  providers: ['glazewm']

Zebar logs are completely clear:

2024-08-07T11:15:04.608540Z  INFO desktop: Creating window #1 'main' with args: {}
2024-08-07T11:15:05.376947Z  INFO desktop::providers::provider: Starting provider: [{"type":"battery","refresh_interval":"5000"}]
2024-08-07T11:15:05.391579Z  INFO desktop::providers::manager: Emitting for provider: [{"type":"battery","refresh_interval":"5000"}]

If there are any relevant logs I should've included let me know, will update the issue.

Changing GlazeWM active workspace doesn't update Zebar component

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.

Question: What am I missing when adding a new provider?

Hi,

Thank you for this project, it made me start learning Rust.

I am trying to add a new provider but the "createProviderListener" does not seem to return from the /client-api/src/providers/{new}/create-{new}-provider.ts file.

These are the places I changed so far, including steps from the contribution guide and a few others (I included those in the guide):

  1. /client-api/src/user-config/window/providers
  2. /client-api/src/user-config/window/providers/index.ts
  3. /client-api/src/user-config/window/provider-type.model.ts
  4. /client-api/src/user-config/window/provider-config.model.ts
  5. /client-api/src/providers
  6. /client-api/src/providers/create-provider.ts
  7. /client-api/src/providers/index.ts
  8. /desktop/src/providers
  9. /desktop/src/providers/config.rs
  10. /desktop/src/providers/variables.rs
  11. /desktop/src/providers/manager.rs
  12. /desktop/src/providers/mod.rs

Here is my branch of what I have so far.

I managed to run the project in dev mode (pnpm dev) and I tried different things to figure out what I am missing:

  • Changed an existing provider's return variable to another value in the get_refreshed_variables function (provider.rs). It worked.
  • Added new variables to an existing provider. It worked.
  • Modified an existing provider to load the variables that my new provider is supposed to return. It worked.

Despite all this, I am still missing something, as the dev console never shows my new provider emitted. I have other questions, but I save those for later :)

Thank you for any hints! (God, I hope it's not a typo)

currentMonitor in komorebi provider doesn't work

Have to use this code to display monitor current workspace name.

          <span class="workspace">
            {{ komorebi.allMonitors.find(m => self.args.MONITOR_NAME.includes(m.name))?.workspaces[komorebi.allMonitors.find(m => self.args.MONITOR_NAME.includes(m.name))?.focusedWorkspaceIndex].name }}
          </span>

komorebi.currentMonitor display only primary monitor on my setup

my config
# Yaml is white-space sensitive (use 2 spaces to indent).

###
# Settings to apply to all windows.
#
# Docs regarding global: https://some-future-docs-link.com
global:
  # Whether to enable the browser devtools.
  enable_devtools: true

###
# Define a new window with an id of 'bar'. This window can then be opened
# via the Zebar cli by running 'zebar open bar'.
#
# Docs regarding window: https://some-future-docs-link.com
window/bar:
  providers: ['self']
  enable_devtools: true
  # Width of the window in physical pixels.
  width: '{{ self.args.MONITOR_WIDTH }}'
  # Height of the window in physical pixels.
  height: '45'
  # X-position of the window in physical pixels.
  position_x: '{{ self.args.MONITOR_X }}'
  # Y-position of the window in physical pixels.
  position_y: '{{ self.args.MONITOR_Y }}'
  # Whether to show the window above/below all others.
  # Allowed values: 'always_on_top', 'always_on_bottom', 'normal'.
  z_order: 'normal'
  # Whether the window should be shown in the taskbar.
  show_in_taskbar: false
  # Whether the window should have resize handles.
  resizable: false
  # Styles to apply globally within the window. For example, we can use
  # this to import the Nerdfonts icon font. Ref https://www.nerdfonts.com/cheat-sheet
  # for a cheatsheet of available Nerdfonts icons.
  global_styles: |
    @import "https://www.nerdfonts.com/assets/css/webfont.css";
  # CSS/SCSS styles to apply to the root element within the window.
  styles: |
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    height: 100%;
    color: #ffffffe6;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    padding: 0px 20px;
    padding-left: 0px;

    .group {
      padding: 10px 18px;
      border-radius: 4px;
    }

  group/left:
    styles: |
      display: flex;
      align-items: center;
      gap: 10px;
      width: fit-content;
      padding: 0;
      background: #00000000;

    template/workspace-name:
      styles: |
        display: flex;
        align-items: center;
        gap: 6px;

        .workspace {
          background: #0000008f;
          width: auto;
          height: auto;
          padding: 10px 20px;
          color: #ffffffe6;
          border: none;
          border-radius: 4px;

          &.active {
            background: rgba(255, 255, 255, 1.0);
            color: #000000e6;
          }

          &:hover {
            background: rgba(255, 255, 255, 0.25);
          }
        }
      providers: ['komorebi', 'self']
      template: |
          <span class="workspace">
            {{ komorebi.allMonitors.find(m => self.args.MONITOR_NAME.includes(m.name))?.workspaces[komorebi.allMonitors.find(m => self.args.MONITOR_NAME.includes(m.name))?.focusedWorkspaceIndex].name }}
          </span>

    template/layout:
      styles: |
        display: flex;
        align-items: center;
        flex-direction: column;
        padding: 10px 20px;
        color: #ffffffe6;
        border: none;
        border-radius: 4px;
        background: #0000008f;

      providers: ['komorebi']
      template: |
        @switch (komorebi.currentWorkspaces[komorebi.currentMonitor.focusedWorkspaceIndex].layout) {
          @case ('bsp') {<span>[\\]</span>}
          @case ('vertical_stack') {<span>[V]=</span>}
          @case ('horizontal_stack') {<span>[H]=</span>}
          @case ('ultrawide_vertical_stack') {<span>||=</span>}
          @case ('rows') {<span>[==]</span>}
          @case ('grid') {<span>[]</span>}
          @case ('custom') {<span>Custom</span>}
          @default {<span>{{ komorebi.currentWorkspaces[komorebi.currentMonitor.focusedWorkspaceIndex].layout.layout }}</span>}
        }

  group/center:
    styles: |
      justify-self: center;
      align-items: center;
      display: flex;
      gap: 20px;

    template/workspaces:
      styles: |
        display: flex;
        align-items: center;
        gap: 6px;

        .workspace {
          background: #0000008f;
          width: auto;
          height: auto;
          padding: 10px 12px;
          color: #ffffffe6;
          border: none;
          border-radius: 4px;

          &.active {
            background: rgba(255, 255, 255, 1.0);
            color: #000000e6;
          }

          &:hover {
            background: rgba(255, 255, 255, 0.25);
          }
        }
      providers: ['komorebi']
      template: |
        @for (workspace of komorebi.currentMonitor.workspaces) {
          <button class="workspace {{ workspace === komorebi.focusedWorkspace && 'active' }}">
            {{ komorebi.currentWorkspaces.indexOf(workspace) + 1 }}
          </button>
        }

  group/right:
    styles: |
      background: #0000008f;
      justify-self: end;
      display: flex;
      align-items: center;
      gap: 20px;

      i {
        color: #7481b2e1;
        margin-right: 7px;
      }

    template/memory:
      providers: ['memory']
      template: |
        <i class="nf nf-fae-chip"></i>
        {{ Math.round(memory.usage) }}%

    template/cpu:
      providers: ['cpu']
      styles: |
        .high-usage {
          color: #900029;
        }
      template: |
        <i class="nf nf-oct-cpu"></i>

        <!-- Change the text color if the CPU usage is high. -->
        @if (cpu.usage > 85) {
          <span class="high-usage">{{ Math.round(cpu.usage) }}%</span>
        } @else {
          <span>{{ Math.round(cpu.usage) }}%</span>
        }

    template/clock:
      providers: ['date']
      # Available date tokens: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
      template: |
        {{ date.toFormat(date.now, 't') }}

Question: Komorebi Workspace Icons per monitor?

Hi, thanks for creating Zebar, I really like it so far.

I have two monitors and when I switch workspaces, I notice that the active workspace changes on both monitors. Is it possible to configure Zebar different per monitor?

Thanks.

[Feature Request] Add --config option to Zebar (or something similar)

Request

Curently, zebar only reads configs from %userprofile%/.glzr/zebar/config.yaml (for Windows), which can sometimes be a pain for people who store their configs somewhere else. A CLI option to specify a different config file would be a nice QOL feature.

Notes

It seems that read_config_file() in the Rust backend already has a override argument, but it isn't used anywhere in the Client API.

Komorebi workspaces not updating on multi-monitor setup

There is a bunch of really wierd behaviour in trying to set this up. The default config loaded fine but when defining a custom css stylings it all went very odd.

I dont really know where to begin but i guess the most important thing is that the css i define in the config.yaml does not appear on all the monitors all the time. Sometimes the css stylings are not applied across the monitors the same. If i set some background color, then quit and relaunch zebar then it will show that on one screen but not the others. Then when i try to change the komorebi workspace on that monitors working bar it will break and show nothing and then start working on the other monitors?

When updating the config and right clicking on the refresh button there it might work and update the change i made in the config, or it may not update the change i made in the config, it may do this on one screens bar only, it might not show anything on one or more of the bars anymore. If i change the komorebi workspace when this is happening it may break it more or it might start magically working with either the new config i updated or the old one?

The most annoying thing by far though is making a change, then quitting the bar and relauching the bar, realising that change broke the bar, undo the change in the config, quit and relauch the bar with the old config that did work, and now the bar doesn't work despite the config working moments ago!

I really dont know what is going on and this is issue is not really usefull for fixing that. I dont even know where to start looking to track down some of these issues. The best i can do if say that i am running the latest komorebi - v0.1.22, OS Name Microsoft Windows 11 Pro N, Version 10.0.22631 Build 22631.

I would love to see some example configs from some users who have a nicely configured bar.

i dont know if there is some settings within komorebi that might be tripping me up, there may be some options in the config for zebar that im missing that might make something work, there may be some dependencies i need but am lacking, maybe im trying to refresh the bar in the wrong way (right click and refresh or quit zebar and relaunch it or do something else?).

Maybe There is some way to preview the css in the config via developer tools or something that means i dont neeed to refresh or realunch so often?

I'm not expecting much from this issue as this is lacking in so many details but this would be a mile long if i tried to capture all these odd things.

bug: "catching-up" on wake and bar freeze when using window manager providers

Description
When I wake my laptop from a long sleep it seem like that requests to update the bar are piled up and executed in a rapid manner.

To reproduce

  1. I set the CPU provider to display a more accurate reading in order to reproduce this issue
    <span>{{cpu.usage.toFixed(3)}}%</span>
  2. I left my laptop in sleep mode for 1-3 hours.
  3. When I wake my laptop the bar executes the piled up readings that did not get to update the bar yet.

Video of the bug

7e8c8957-15d4-4a56-a37a-24b17cda798e.mp4

I suspect it might have something to do with the code here, I am not sure.

Perhaps the solution is to introduce a timeout on the callback to the provider, so after some time the result is ignored or the call simply abandoned.

RunError: Failed to initialize window! (Installed Zebar through scoop)

Environment:

Windows 10 (Minor: 0; Build: 19045; Revision: 0)

Setup

  • Followed the steps in #37 to install through scoop (Why? : Had to install it without admin rights)
> scoop bucket add mtb https://github.com/melMass/scoop-mtb.git
> scoop install zebar
  • Installed zebar successfully.

Test

  • zebar works properly in powershell
> zebar monitors
MONITOR_NAME="\\.\DISPLAY1" MONITOR_X="0" MONITOR_Y="0" MONITOR_WIDTH="2560" MONITOR_HEIGHT="1440" MONITOR_SCALE_FACTOR="1"

Issue

  • Running start.bat throws the error:

Failed to initialize window!
Problem reading config file. Command 'read_config_file' failed: "Unable to write to C:\Users\USER\.glzr/zebar\config.yaml"

Shell Status

image

Error Notification

image

json bad choice for config file

yaml,toml much preferable for many reasons throughout the web, could maintain backwards compatibility by searching for yaml first, with json as fallback

launching the zebar silently

i am using the start.bat file to launch the zebar. how can i launch it as a no-console application without terminal that shows the activities?
when i launch it i have this terminal open (minimized):

image

Nothing happens after running start script

Running the start script (start.bat in this case) produces no example config.yaml nor a bar of any kind.

Output from Terminal:

 2024-07-06T08:59:25.650028Z  INFO desktop: Creating window #1 'bar' with args: {
    "MONITOR_Y": "0",
    "MONITOR_WIDTH": "3840",
    "MONITOR_NAME": "\\\\.\\DISPLAY1",
    "MONITOR_X": "0",
    "MONITOR_HEIGHT": "2160",
    "MONITOR_SCALE_FACTOR": "1.5",
}

And then leaves an empty tmp folder in %user%/.glzr/zebar, I checked Task Manager and see that zebar is still running as a background process however.

Komorebi provider not working

Hi!
This project is the thing I have been looking for some time to integrate with Komorebi. However, I have been unable to use it yet as with the instructions provided, the workspaces from komorebi do not show up.
My configuration:

# Yaml is white-space sensitive (use 2 spaces to indent).

###
# Settings to apply to all windows.
#
# Docs regarding global: https://some-future-docs-link.com
global:
  # Whether to enable the browser devtools.
  enable_devtools: true

###
# Define a new window with an id of 'bar'. This window can then be opened
# via the Zebar cli by running 'zebar open bar'.
#
# Docs regarding window: https://some-future-docs-link.com
window/bar:
  providers: ['self']
  # Width of the window in physical pixels.
  width: '{{ self.args.MONITOR_WIDTH }}'
  # Height of the window in physical pixels.
  height: '45'
  # X-position of the window in physical pixels.
  position_x: '{{ self.args.MONITOR_X }}'
  # Y-position of the window in physical pixels.
  position_y: '{{ self.args.MONITOR_Y }}'
  # Whether to show the window above/below all others.
  # Allowed values: 'always_on_top', 'always_on_bottom', 'normal'.
  z_order: 'always_on_top'
  # Whether the window should be shown in the taskbar.
  show_in_taskbar: false
  # Whether the window should have resize handles.
  resizable: false
  # Styles to apply globally within the window. For example, we can use
  # this to import the Nerdfonts icon font. Ref https://www.nerdfonts.com/cheat-sheet
  # for a cheatsheet of available Nerdfonts icons.
  global_styles: |
    @import "https://www.nerdfonts.com/assets/css/webfont.css";
  # CSS/SCSS styles to apply to the root element within the window.
  styles: |
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    height: 100%;
    color: #ffffffe6;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    padding: 4px 24px;
    border-bottom: 1px solid #ffffff08;
    background: linear-gradient(
      rgba(14, 14, 28, 0.95),
      rgba(26, 14, 28, 0.85),
    );
  group/left:
    styles: |
      display: flex;
      align-items: center;

    template/logo:
      styles: |
        margin-right: 20px;
      template: |
        <i class="nf nf-fa-windows"></i>

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

        .workspace {
          background: rgba(255, 255, 255);
          margin-right: 4px;
          width: 30px;
          height: 30px;
          color: #ffffffe6;
          border: none;
          border-radius: 2px;

          &.active {
            background: rgba(255, 255, 255, 0.1);
          }
        }
      providers: ['komorebi']
      template: |
        @for (workspace of komorebi.currentWorkspaces) {
          <button class="workspace {{ workspace === komorebi.focusedWorkspace && 'active' }}">
            {{ workspace.name }}
          </button>
        }

  group/center:
    styles: |
      justify-self: center;

    template/clock:
      providers: ['date']
      # Available date tokens: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
      template: |
        {{ date.toFormat(date.now, 'd MMM t') }}

  group/right:
    styles: |
      justify-self: end;
      display: flex;

      .template {
        margin-left: 20px;
      }

      i {
        color: #7481b2e1;
        margin-right: 7px;
      }

    template/memory:
      providers: ['memory']
      template: |
        <i class="nf nf-fae-chip"></i>
        {{ Math.round(memory.usage) }}%

    template/cpu:
      providers: ['cpu']
      styles: |
        .high-usage {
          color: #900029;
        }
      template: |
        <i class="nf nf-oct-cpu"></i>

        <!-- Change the text color if the CPU usage is high. -->
        @if (cpu.usage > 85) {
          <span class="high-usage">{{ Math.round(cpu.usage) }}%</span>
        } @else {
          <span>{{ Math.round(cpu.usage) }}%</span>
        }

    template/battery:
      providers: ['battery']
      styles: |
        position: relative;

        .charging-icon {
          position: absolute;
          font-size: 11px;
          left: 7px;
          top: 2px;
        }
      template: |
        <!-- Show icon for whether battery is charging. -->
        @if (battery.isCharging) {<i class="nf nf-md-power_plug charging-icon"></i>}

        <!-- Show icon for how much of the battery is charged. -->
        @if (battery.chargePercent > 90) {<i class="nf nf-fa-battery_4"></i>}
        @else if (battery.chargePercent > 70) {<i class="nf nf-fa-battery_3"></i>}
        @else if (battery.chargePercent > 40) {<i class="nf nf-fa-battery_2"></i>}
        @else if (battery.chargePercent > 20) {<i class="nf nf-fa-battery_1"></i>}
        @else {<i class="nf nf-fa-battery_0"></i>}

        {{ Math.round(battery.chargePercent) }}%

    template/weather:
      providers: ['weather']
      template: |
        @switch (weather.status) {
          @case ('clear_day') {<i class="nf nf-weather-day_sunny"></i>}
          @case ('clear_night') {<i class="nf nf-weather-night_clear"></i>}
          @case ('cloudy_day') {<i class="nf nf-weather-day_cloudy"></i>}
          @case ('cloudy_night') {<i class="nf nf-weather-night_alt_cloudy"></i>}
          @case ('light_rain_day') {<i class="nf nf-weather-day_sprinkle"></i>}
          @case ('light_rain_night') {<i class="nf nf-weather-night_alt_sprinkle"></i>}
          @case ('heavy_rain_day') {<i class="nf nf-weather-day_rain"></i>}
          @case ('heavy_rain_night') {<i class="nf nf-weather-night_alt_rain"></i>}
          @case ('snow_day') {<i class="nf nf-weather-day_snow"></i>}
          @case ('snow_night') {<i class="nf nf-weather-night_alt_snow"></i>}
          @case ('thunder_day') {<i class="nf nf-weather-day_lightning"></i>}
          @case ('thunder_night') {<i class="nf nf-weather-night_alt_lightning"></i>}
        }
        {{ weather.celsiusTemp }}°

What I currently see:

image

Make Nerd Font icons available offline instead of fetching them

There are many problems that occur with an online approach:

Problem Case 1: You are outside without an internet connection, Zebar will not load it's icons
Problem Case 2: Your system is slow to connect to Wi-Fi which causes Zebar to start on launch without icons
Problem Case 3: Your Wi-Fi is slow/unresponsive, leaving you with no icons in Zebar (happens a lot with me)
Problem Case 4: Site is unresponsive
Problem Case 5: File is moved/removed from Nerdfonts site
Problem Case 6: File is updated and class names can change, making previous use of classes in Zebar do nothing

Consider adding webfont.css file (600kb size) to the project for offline use to solve all the problems above. Offline use does not seem to be breaking any licenses.


Code to change:

# Consider fetching this offline
window/bar:
    global_styles: |
        @import "https://www.nerdfonts.com/assets/css/webfont.css";

  • No icons Without Wi-Fi:
    • image
  • With Wi-Fi:
    • image

Focus Workspace GlazeWM

`

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

      .workspace {
        background: rgba(44, 122, 254, 1);
        margin-right: 4px;
        width: 30px;
        height: 30px;
        color: #ffffffe6;
        border: none;
        border-radius: 2px;
          
      }   
    providers: ['glazewm']
    template: |
      @for (workspace of glazewm.workspacesOnMonitor) {
        <button class="workspace">
          {{ workspace.name }}
        </button>
      }  

`
How can I highlight the workspace in use in different colors?
and is it possible to click on the workspace number to change workspace?

immagine

[Feature Request] Shell / text provider

Summary

Request to add support for reading from text files and/or executing scripts at scheduled intervals in Zebar.

Description

I've used GlazeWM v2 to display time tracking information from Toggl. I've created a shell script to output the status of a CLI to a text file, which was then read by the status bar. A cronjob on my local machine ran the script every two minutes to keep it up-to-date. Can Zebar include a feature to read from a text file or possibly execute a script at scheduled intervals?

Use Case

This feature would be useful for displaying dynamic and real-time information from various sources, such as time tracking tools, system monitoring scripts, or any other data that can be output to a text file or script.


PS: I've just installed the new version of GlazeWM & Zebar and it works great!

[Feature Request] Reserve screen space for zebar

There is this another bar app called yasb which automatically reserves screen space for the bar so that the windows resize and are not overlapped by the bar.
I'm using zebar with komorebi, and it doesn't do that.
It would be great if this could be added.
Thanks

System Tray provider

Hello! I have looked through the configs and docs but cannot find an option to have a system tray provider. Is there a way to show the system tray in the bar?

[Feature Request] - Enable nightly builds

It would be nice to have nightly builds listening to main.

With the current state of Zebar and Komorebi compability it would be nice to not have to wait for an new Release or build from source.

Start as a service?

I've been looking for such a projects for a long time (I tried various alternatives and currently use rainmeter which I'm not a fan of). Thanks for that.

I mainly use a mac an a windows PC but I never understood services on the later, I know how to use LaunchAgent etc on mac and it works fine, what would be the alternative on windows to setup the bat file as a service? Is there some idiomatic way?

Thanks

macOS version

Has anyone tried using it on macOS yet? I installed the latest release, but I'm a little lost on how it works as nothing shows up when I run zebar. If I try to run from command line:

/Applications/Zebar.app/Contents/MacOS/Zebar open bar

I get an error saying that the width in config isn't valid. Number must be greater than or equal to 1..

I'm guessing from this line in the config width: '{{ self.args.MONITOR_WIDTH }}'

Bug: only first element is selected by selector in events

I was playing with komorebi provider and trying to implement focus workspace for it.
I've noticed a bug with selector. Its selects only first element in template. So its impossible to implement such thing for arbitrary number of workspaces. Only manually selecting each works is possible for now.

is that intentionally?

I was following sample conifg to get events to work. And seems provided example is also broken.

My template:

    template/workspaces:
      providers: ['komorebi']
      events:
        - type: 'click'
          fn_path: 'script.js#focusWorkspace'
          selector: '.workspace'

      template: |
        @for (workspace of komorebi.currentMonitor.workspaces) {
          @if (workspace.tilingContainers.length >= 0 
            || workspace.floatingWindows.length > 0 
            || workspace.maximizedWindow
            || workspace.monocleContainer
            || workspace === komorebi.currentMonitor.workspaces[komorebi.currentMonitor.focusedWorkspaceIndex]
        ) {
            @if (workspace === komorebi.currentMonitor.workspaces[komorebi.currentMonitor.focusedWorkspaceIndex]) {
              <button class="workspace active" data-index="{{ komorebi.currentMonitor.workspaces.indexOf(workspace) }}">
                {{ workspace.name.split(" ")?.[1] ?? workspace.name }}
              </button>
            } @else {
              <button class="workspace icon" data-index="{{ komorebi.currentMonitor.workspaces.indexOf(workspace) }}">
                {{ workspace.name.split(" ")[0] }}
              </button>
            }
          }
        }

changing the width of workspaces

hi, thanks for this repo.
how can i increase the width of the komorebi workspaces? I have tried width param in workspaces section but couldn't make it to work.

image

part of the config:

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

        .workspace {
          background: rgba(255, 255, 255, 0.05);
          margin-right: 4px;
          width: 30px;
          height: 30px;
          color: #ffffffe6;
          border: none;
          border-radius: 2px;

          &.active {
            background: rgba(255, 255, 255, 0.1);
          }
        }
      providers: ["komorebi"]
      template: |
        @for (workspace of komorebi.currentWorkspaces) {
          <button class="workspace {{ workspace === komorebi.focusedWorkspace && 'active' }}">
            {{ workspace.name }}
          </button>
        }

Compile error on WSL

I'm trying on WSL to compile from source but can't find what is wrong.

packages/client dev: [TypeScript] Found 0 errors. Watching for file changes.
packages/client-api dev: DTS ⚡️ Build success in 5579ms
packages/desktop dev: error: cannot find attribute `unix_sigpipe` in this scope
packages/desktop dev:    --> src/main.rs:105:3
packages/desktop dev:     |
packages/desktop dev: 105 | #[unix_sigpipe = "sig_dfl"]
packages/desktop dev:     |   ^^^^^^^^^^^^
packages/desktop dev: warning: unused import: `crate::util::window_ext::WindowExt`
packages/desktop dev:   --> src/main.rs:24:5
packages/desktop dev:    |
packages/desktop dev: 24 | use crate::util::window_ext::WindowExt;
packages/desktop dev:    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
packages/desktop dev:    |
packages/desktop dev:    = note: `#[warn(unused_imports)]` on by default
packages/desktop dev: warning: unused import: `anyhow::Result`
packages/desktop dev:  --> src/util/window_ext.rs:1:5
packages/desktop dev:   |
packages/desktop dev: 1 | use anyhow::Result;
packages/desktop dev:   |     ^^^^^^^^^^^^^^
packages/desktop dev: error[E0635]: unknown feature `unix_sigpipe`
packages/desktop dev:  --> src/main.rs:1:12
packages/desktop dev:   |
packages/desktop dev: 1 | #![feature(unix_sigpipe)]
packages/desktop dev:   |            ^^^^^^^^^^^^
packages/desktop dev: For more information about this error, try `rustc --explain E0635`.
packages/desktop dev: error: could not compile `desktop` (bin "desktop") due to 2 previous errors; 2 warnings emitted

Multiple Monitors Support

image
I possess two monitors. The initial one is my typical monitor, yet the second one is a larger monitor with a scale of 300%. When I activate Monitor 2 and switch to it while Zebar is operational, the bar fails to resize automatically and remains in a small size.

[Feature Request] Missing providers

I've looked through the code and docs but couldn't find some providers that we had using the older GlazeWM version like:

  • window title
  • music
  • gpu
  • volume

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.