geommer / yabar

A modern and lightweight status bar for X window managers.
MIT License
679 stars 49 forks source link

[Question] How does one center a bar? #172

Closed vinnyA3 closed 6 years ago

vinnyA3 commented 6 years ago

How does one go about centering a bar? I am trying to recreate something similar to the top bar from the screenshot located on the README page. I came up with a solution that utilizes block-background colors and compton, but it just seems too hacky.

For me, setting the width of the bar doesn't seem to work as expected. If I understand correctly, the width and starting position of the bar is calculated using the gap-horizontal property, but I find gap-horizontal / gap-vertical to be rather enigmatic - I'm not sure how they work exactly. Any insight would be greatly appreciated. Thanks!

P.S: Using the 'YABAR-SONG' internal block, while the default player is inactive, introduces a race condition, one of which chews at the cpu. I wrote a bash script that helps to resolve this issue, but I was wondering if there was an internal solution to this?

NBonaparte commented 6 years ago

Are you using i3? I remember when I used i3, bars couldn't position themselves arbitrarily and had to extend to the width of the monitor. Also, I seem to recall gaps not working.

Could you post the script here? I'll see if I can integrate its functionality or a similar workaround to mitigate this issue.

vinnyA3 commented 6 years ago

I am using i3 unfortunately ☹️; however, I did settle upon a layout that I really like.

I couldn't figure out what was going wrong, so it's good to know that this bug lies in Yabar's interaction with i3.

About the script ... It's really just a small program that, when spotify is launched, kills the running yabar instance and loads a different configuration - one with the playerctl block included. I kind of circumvented the issue here, instead of setting up a watcher of sorts. If you would really like to check it out, I'd be glad to post it though.

Anyway, I appreciate your response. I'm really interested in contributing what I can to this project. I'll look into some C this weekend; maybe I can assist in building upon the source. Cheers.