TimUntersberger / nog

A tiling window manager for Windows
MIT License
697 stars 20 forks source link

Set limit for current_window bar component length #275

Closed keepitsane closed 3 years ago

keepitsane commented 3 years ago

I was wondering if it is possible to limit the length of the current_window component. Occasionally when I have a browser tab with a long title it overlaps over the other components I have on my bar.

Here is a picture to show: image

What it normally looks like with a short title: image

TimUntersberger commented 3 years ago

I think the current window component should just be cut off instead of overlapping other components in such a case.

keepitsane commented 3 years ago

Here is my config for my bar. Am I doing something incorrect to get it cutoff?

nog.config.bar.components = {
  left = {nog.components.workspaces()},
  center = {nog.components.datetime("%I:%M:%S %p")},
  right = {
    nog.components.active_mode(),
    nog.components.padding(4),
    nog.components.fullscreen_indicator("[]"),
    nog.components.padding(1),
    nog.components.split_direction({"|", "-"}),
    nog.components.padding(1),
    nog.components.current_window(),
    nog.components.padding(3),
    nog.components.datetime("%a, %e %b %Y")
  }
}
TimUntersberger commented 3 years ago

I think the current window component should just be cut off instead of overlapping other components in such a case.

This was intended as a "we should change it to this behaviour"

keepitsane commented 3 years ago

The current_window() component used to only display on the workspace that the window is active on. But it seems now that the current_window() displays that same across all workspaces even on different monitors. I feel like it should really only show on the monitor that has the window rather than all. What do you think?

TimUntersberger commented 3 years ago

@keepitsane this should actually not be happening in the latest version. Do you have the latest version?

keepitsane commented 3 years ago

I just updated to the latest master version and am still experiencing both issues.

ramirezmike commented 3 years ago

I'm curious, when you installed it did you also replace the lua runtime in your appdata folder?

keepitsane commented 3 years ago

I'm curious, when you installed it did you also replace the lua runtime in your appdata folder?

That was the issue. I assumed the nog.exe would auto replace the runtime as well, like the bin. But this did fix that issue, thank you!

ramirezmike commented 3 years ago

I'm curious, when you installed it did you also replace the lua runtime in your appdata folder?

That was the issue. I assumed the nog.exe would auto replace the runtime as well, like the bin. But this did fix that issue, thank you!

@TimUntersberger this might be something we might want to document or automate? As we make changes to the lua runtime it might not be obvious that the nog.exe and the runtime need to be replaced.

TimUntersberger commented 3 years ago

Maybe an "How to update" subsection in the getting started section.

TimUntersberger commented 3 years ago

The more I think about it the harder this seems to be 🤔 Maybe just using your initial idea of a max width is better.

TimUntersberger commented 3 years ago

Newest version now supports a max_width argument for the current_window component.

TimUntersberger commented 3 years ago

I assumed the nog.exe would auto replace the runtime as well, like the bin. But this did fix that issue, thank you!

Running the following line should update everything.

(iwr "https://raw.githubusercontent.com/TimUntersberger/nog/master/bin/download_release.ps1").Content > download.ps1; ./download.ps1 master-release; rm download.ps1