FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
6.55k stars 95 forks source link

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

Open wilfredjonathanjames opened 1 month ago

wilfredjonathanjames commented 1 month ago
sketchybar@v2.21.0

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 commented 3 weeks ago

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