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

Brackets require background.height, padding doesn't work, etc #639

Open
wilfredjonathanjames opened this issue Oct 25, 2024 · 1 comment

Comments

@wilfredjonathanjames
Copy link

wilfredjonathanjames commented Oct 25, 2024

Hi there,

First of all thanks for SketchyBar. It's a fantastic bit of kit.

I'm setting up left-right bars around the notch using the q-e anchor + brackets trick.

Here's a minimal repro:

sketchybar \
    --bar height=30 color=0x00000000 y_offset=15 notch_width=330 padding_left=15 \
    --add item l_bar__l_anchor left \
        --set l_bar__l_anchor label.background.color=0xffff0000 label="LEFT" \
    --add item l_bar__r_anchor q \
      --set l_bar__r_anchor label.background.color=0xffff0000 label="RIGHT" \
    --add bracket left_bar l_bar__l_anchor l_bar__r_anchor \
      --set left_bar \
        background.color=0xff4e4e4e \
        background.height=30 \
        padding_left=100 \
        background.padding_left=100 \
    --update

Which gives the following to the left of my notch:
image

Current behaviour

  1. If you delete the line background.height=30 \, the bracket disappears completely. There's no mention I can find of this in the docs, and from what I understand of the examples and plugin code I've seen it's meant to calculate height automatically. Could be wrong about that.
  2. You'll notice left_padding and background.left_padding aren't applying padding. I'm not sure which is intended, for the following reason: a solution is to add default padding_left (code below). I'm not sure why this works, but it means that every item needs to have padding reset if it differs from brackets.

Bracket padding hack:

sketchybar \
    --bar height=30 color=0x00000000 y_offset=15 notch_width=330 padding_left=15 \
    --default padding_left=100 \
   ...

image

Expected behaviour

  1. At least a note in the docs about the requirement for background.height on brackets, but ideally calculating height dynamically and removing the requirement.
  2. allowing padding_* and background.padding_* to influence brackets without needing to set defaults.
    1. For someone new to Sketchybar it's unexpected that brackets use the background.* settings for rendering but not the background.padding_* setting. Maybe worth changing that?

Looking forward to hearing from you. Thanks again!

@dovahcrow
Copy link

I noticed the padding doesn't work for the bracket as well! Thanks for the hack info

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

No branches or pull requests

2 participants