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] vertical bar #240

Closed
shaunsingh opened this issue Aug 29, 2022 · 13 comments
Closed

[feature request] vertical bar #240

shaunsingh opened this issue Aug 29, 2022 · 13 comments
Labels
enhancement New feature or request

Comments

@shaunsingh
Copy link

Is it possible to add an option to display the bar vertically on the left or right hand side? elements in the bar would go top to bottom instead of left to right

@FelixKratz
Copy link
Owner

Yes, I could imagine having such options. Popups already draw their items from top to bottom, so the general logic for such a bar is already contained. I would need to do some refactoring of the code while implementing this. I will experiment with this on a secondary branch once I have some free time.

@FelixKratz FelixKratz added the enhancement New feature or request label Aug 31, 2022
@FelixKratz
Copy link
Owner

FelixKratz commented Oct 6, 2022

I did some experimenting with left and right positions of the bar. There are many things that are not working currently (groups, popups, shadows, ...) and this will remain an undocumented and experimental feature till it is fully baked.
I am posting the experimental version of this feature to discuss a way forward with this.

Nothing of this changes anything about top/bottom bars, which is why I have decided to include it on master.

The width, left and right nomenclature in item configuration is not intuitive for left/right bars, at least not in the way that I have reused them currently.

The way I have designed it for now works the following for left/right bars:

  • icon and label of an item are still placed horizontally aligned
  • background paddings act vertically (despite being called left and right padding)
  • item width acts vertically (i.e. width means height)
  • the bar height property determines the width of the bar
  • y_offset is the margin of the bar
  • margin is the x_offset of the bar

All of this is super unintuitive and I am not happy with it. I could overload right with top and left with bottom as well as x_offset and margin to make it a bit better. Those could then be used synonymously in all configurations (e.g. padding_left is equivalent to padding_top).

If there are opinions on how to do this in an intuitive and simple way, I would enjoy to discuss them here.

Demo:
Screen Shot 2022-10-06 at 21 17 49

config:
sketchybar_vertical.zip

@shaunsingh
Copy link
Author

Looks wonderful! Personally I don't use any shadows and popups so this will work just fine for me. aliasing right/left with top/bottom would definitely be a nice QOL improvement but not a big issue or anything. Thank you for the awesome project once again <3

@FelixKratz
Copy link
Owner

I will play with this some more and polish, document and properly test it some time in the future. I will close this for now since it is contained as an experimental feature in the latest release.

@jay0ma
Copy link

jay0ma commented Feb 5, 2023

Would this feature be released any time soon? It looks awesome!

@FelixKratz
Copy link
Owner

I think this feature still needs a lot of work, but technically it should already work in the latest release. It is kept undocumented on purpose for now, since I will probably completely change things some time in the future and it is a bit buggy.

sketchybar --bar position=left

will create a vertical bar, but there are problems with brackets and a lot of other things. My proof of concept config linked above should work fine though

@oxgr
Copy link

oxgr commented Oct 10, 2023

I've been playing with this feature for a bit and for the most part, it works great! Popups still need work as mentioned (mostly with mapping y_offset to x-axis)

I did find a bug introduced in 2.16.0. With bar on the left, it seems to draw contents ~400px to the right of the bar. Placing the bar on right, contents are drawn further out of frame.

Appears in every commit past that, but 2.15.2 works as expected. Tested on two Macbooks with identical configs, one running Metal and one without, both running Ventura 13.6 through OCLP. Could it be the Cocoa library extensions mentioned in changelog?

I don't expect a fix for this many layers of experimental, but figured it might be useful to note. Screenshots of different versions mentioned:

sketchybar-vertical-mbp-2-15-2
sketchybar-vertical-mbp-2-16-4

@FelixKratz
Copy link
Owner

FelixKratz commented Oct 10, 2023

Try the latest commit I think I have fixed it:

brew uninstall sketchybar
brew install sketchybar --head
brew services restart sketchybar

and revert to stable once the release has happened with:

brew uninstall sketchybar
brew install sketchybar
brew services restart sketchybar

btw your bar looks really nice

@oxgr
Copy link

oxgr commented Oct 10, 2023

works on both machines. thank you for the quick fix!

would've taken me a long while to catch that background pointer.

and thank you for the compliment. it definitely looks and feels a lot more natural for me in vertical form as it pushes content towards 3:2 ratio.

what else is needed to move this feature towards stable?

@FelixKratz
Copy link
Owner

what else is needed to move this feature towards stable?

  • Brackets need to be adapted to show properly (currently they will be placed as if the bar is in top position)
  • The naming of certain properties does not work well with vertical layout, e.g. left and right, width, height, y_offset etc.
  • Some more testing

Almost all other things work fine in the current version for vertical layouts, so once the three above points are tackled it might be ready to properly document this feature (and thus make it a stable feature).

Once the feature is documented I don't want to change the syntax again such that the config never breaks, thus the
problem with the property naming is the most important problem and also the reason why this feature has been on hold for so long.

@jay0ma
Copy link

jay0ma commented Oct 12, 2023

I've been playing with this feature for a bit and for the most part, it works great! Popups still need work as mentioned (mostly with mapping y_offset to x-axis)

I did find a bug introduced in 2.16.0. With bar on the left, it seems to draw contents ~400px to the right of the bar. Placing the bar on right, contents are drawn further out of frame.

Appears in every commit past that, but 2.15.2 works as expected. Tested on two Macbooks with identical configs, one running Metal and one without, both running Ventura 13.6 through OCLP. Could it be the Cocoa library extensions mentioned in changelog?

I don't expect a fix for this many layers of experimental, but figured it might be useful to note. Screenshots of different versions mentioned:

sketchybar-vertical-mbp-2-15-2 sketchybar-vertical-mbp-2-16-4

Would you mind sharing your bar configuration? It looks elegant!

@oxgr
Copy link

oxgr commented Oct 14, 2023

The naming of certain properties does not work well with vertical layout, e.g. left and right, width, height, y_offset etc.

Could introduce some attribute aliases that map to whichever attributes/scopes are mirrored 45deg, but avoid for the ones that behave regularly e.g. popup.x_offset -> popup.y_offset, but don't provide label.padding_top.

From there, just need to document which scopes are mirrored, which aren't, and provide a table of mappings.

Would you mind sharing your bar configuration? It looks elegant!

Just posted in the setups thread!

@jay0ma
Copy link

jay0ma commented Oct 14, 2023

Just posted in the setups thread!

Thank you so much! It looks awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants