kkga / nibar

Simple Übersicht status bar with yabai support.
MIT License
191 stars 33 forks source link

add initial implementation for window display #8

Closed Granitosaurus closed 4 years ago

Granitosaurus commented 4 years ago

Hey, this is my first attempt at a Ubersicht widget and in this PR I've added window view similar to spaces view:

image

Let me know what you think!

Granitosaurus commented 4 years ago

The only thing I couldn't figure out is if it's possible to add relative position because now you need to hardcode left padding which I defaulted to 300px here, which leaves space for like 10 windows on 15" mac. Also yabai focus_windows signal doesn't seem to be fired when switching focus relatively (south,east,west,north) but I guess that's an issue with yabai

kkga commented 4 years ago

Thanks for contributing! Looks great!

The only thing I couldn't figure out is if it's possible to add relative position...

Yeah that's tricky, because each widget has to be a top-level node in the DOM tree and it's not possible (afaik) to nest them in a single layout container.

The fixed offset is not ideal, though, so I can see 2 alternative ways to integrate this functionality:

I'm fine with either approach, so let me know which option you prefer 👍

Granitosaurus commented 4 years ago

I've been using this for a week now and I'm not sure if integrating it into spaces widget is a great idea as some people might not like it. as for text-align: center I've tried it and it doesn't look great since it keeps recentering and moving around every time new element so it's kinda distracting. So I think left padded looks the best by far:

image

I've added preliminary implementation for config support:

Though maybe that should be part of styles.jsx? Sorry I'm not very familiar with javascript.