FelixKratz / SketchyBar

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

bracket border not showing #549

Closed leviszaboo closed 1 month ago

leviszaboo commented 1 month ago

Hi, Is there a reason why the bracket border is not showing? Until the background height line everything is rendered correctly and when I change and reload it also changes. However, when I try to set the background border, it is unresponsive.

Screenshot 2024-05-20 at 11 18 31
FelixKratz commented 1 month ago

Could you provide a minimal snippet for this? Seems to work fine if I try it with one of my brackets.

leviszaboo commented 1 month ago

items/spaces.sh:

#!/bin/bash

bottom_bar --add item space_separator left   \
           --set space_separator icon="􀆊" \
                                 padding_right=12  \
                                 padding_left=8  \
                                 icon.color=$WHITE \
                                 icon.padding_left=4 \
                                 label.drawing=off  \
                                 background.drawing=off  \
                                 script="$PLUGIN_DIR/space_windows.sh" \
           --subscribe space_separator space_windows_change

SPACE_ICONS=("1" "2" "3" "4" "5")

for i in "${!SPACE_ICONS[@]}"
do
  sid="$(($i+1))"
  space=(
    space="$sid"
    icon="${SPACE_ICONS[i]}"
    icon.padding_left=10
    icon.padding_right=4
    label.padding_left=4
    label.padding_right=18
    label.font="sketchybar-app-font:Regular:14.0"
    label.y_offset=-1
    background.corner_radius=5
    background.height=25
    script="$PLUGIN_DIR/spaces.sh"
  )
  bottom_bar --add space space."$sid" left --set space."$sid" "${space[@]}" 
done

bottom_bar --add bracket spaces '/space\..*/' space_separator \
           --set spaces background.color=$BRACKET_COLOR \
                        background.corner_radius=8 \
                        background.height=35 \ 
                        background.border_color=0xffc8c093 \
                        background.border_width=2 

plugins/spaces.sh:

#!/bin/sh

source "$CONFIG_DIR/colors.sh" 

if [ $SELECTED = true ]; then
  bottom_bar --set $NAME label.color=$ACCENT_COLOR \
                         icon.color=$ACCENT_COLOR
else
  bottom_bar --set $NAME label.color=$WHITE \
                         icon.color=$WHITE
fi

plugins/space_windows.sh:

#!/bin/bash

if [ "$SENDER" = "space_windows_change" ]; then
  space="$(echo "$INFO" | jq -r '.space')"
  apps="$(echo "$INFO" | jq -r '.apps | keys[]')"

  icon_strip=" "
  if [ "${apps}" != "" ]; then
    while read -r app
    do
      icon_strip+=" $($CONFIG_DIR/plugins/icon_map_fn.sh "$app")"
    done <<< "${apps}"
  else
    icon_strip=" —"
  fi

  bottom_bar --set space.$space label="$icon_strip"
fi

sketchybarrc:

#!/bin/bash

source "$CONFIG_DIR/colors.sh"

PLUGIN_DIR="$CONFIG_DIR/plugins"
ITEM_DIR="$CONFIG_DIR/items"

bar_bottom=(
  padding_left=0
  padding_right=0
  position=bottom
  height=38
  corner_radius=8
  blur_radius=30
  margin=12
  y_offset=6
  shadow=true
  color=$BAR_COLOR
)

bottom_bar --bar "${bar_bottom[@]}"

default=(
  padding_left=5
  padding_right=5
  icon.font="SF Pro:Semibold:14.0"
  label.font="SF Pro:Semibold:13.0"
  icon.color=$WHITE
  label.color=$WHITE
  background.color=$ITEM_BG_COLOR
  background.corner_radius=5
  icon.padding_left=9
  icon.padding_right=4
  label.padding_left=4
  label.padding_right=9
)

bottom_bar --default "${default[@]}"

# Left items
source "$ITEM_DIR/spaces.sh"

bottom_bar --update

This is all my configuration besides the color variables and the icon map function. No idea what could be the issue, it also works for me in other brackets, although in the top bar.

FelixKratz commented 1 month ago

There is an additional space after the \ character in this line:

                        background.height=35 \

remove it and it should work fine.

My text editor shows it really clearly: Screenshot 2024-05-21 at 15 35 57