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

Bracket paddings behave strange #211

Closed
FelixKratz opened this issue Jul 3, 2022 Discussed in #210 · 0 comments
Closed

Bracket paddings behave strange #211

FelixKratz opened this issue Jul 3, 2022 Discussed in #210 · 0 comments
Labels
available on master bug Something isn't working

Comments

@FelixKratz
Copy link
Owner

Bracket offset and padding calculation has been fixed in 9218890.

Discussed in #210

Originally posted by irls-svg July 3, 2022
Hey all,

I've been trying to remove the extra padding on the right hand side of one of my brackets (to have it match the left hand side) but can't seem to work it out for the life of me.

What I've got at the moment is this:
Screen Shot 2022-07-03 at 16 49 41
Screen Shot 2022-07-03 at 16 49 34

What I'm trying to do is have it so that the padding around the 'media' item matches the padding around 'main', removing that little extra gap on the end (highlighted in red below). I've tried setting the padding of every item's icon, label, background on that end to 0, setting the bracket's padding to 0, and tried negative values as well with no luck.
Screen Shot 2022-07-03 at 16 46 41

Not sure if it's something I've screwed up/am missing or if it's some kind of built-in padding? I've noticed that brackets have the ability to set icons/labels, and that labels seem to be a bit funny with padding sometimes (haven't been able to pinpoint exactly how, though) -- could it possibly be something to do with that? Regardless, any suggestions or workarounds are super appreciated!

bracket info + image of bracket w/ label & icon
Screen Shot 2022-07-03 at 17 04 11
Output of 'sketchybar --query spaces_bracket':
{
	"name": "spaces_bracket",
	"type": "b",
	"text": {
		"icon": "",
		"label": "",
		"icon.font": "Hack Nerd Font:Bold:10.0",
		"label.font": "Hack Nerd Font:Normal:12.0"
	},
	"geometry": {
		"position": "s",
		"fixed_width": -1,
		"background.padding_left": 0,
		"background.padding_right": 0,
		"icon.padding_left": 0,
		"icon.padding_right": 0,
		"label.padding_left": 0,
		"label.padding_right": 0
	},
	"style": {
		"icon.color": "0xffa8c0dc",
		"icon.highlight_color:": "0xff0f1b28",
		"label.color": "0xffa8c0dc",
		"label.highlight_color:": "0xff0f1b28",
		"background.drawing": 1,
		"background.height": 25,
		"background.corner_radius": 4,
		"background.border_width": 0,
		"background.color": "0xff0f1b28",
		"background.border_color": "0x0"
	},
	"state": {
		"drawing": 1,
		"updates": 1,
		"lazy": 1,
		"associated_bar_mask": 1,
		"associated_display_mask": 0,
		"associated_space_mask": 0,
		"update_mask": 0
	},
	"bounding_rects": {
		"display-1": {
			"origin": [ 22.000000, 6.000000 ],
			"size": [ 433.000000, 22.000000 ]
		}
	},
	"bracket": [
		"spacer",
		"main",
		"social",
		"browser",
		"code",
		"terminal",
		"media",
		"right_spacer"
	]
}
relevant sketchybarrrc (in the middle of working on it pls excuse the inconsistent formatting 😅)
PADDING=10
INNER_PADDING=6
SPACE_ICON=""
FONT="Hack Nerd Font"
PLUGIN_DIR="$HOME/.config/sketchybar/plugins"

# COLOURS

nil="0x00000"
background="0xff0F1B28"
color7="0xffa8c0dc"

# BAR SETTINGS

sketchybar --bar height=22                                                \
                 margin=22                                                \
                 y_offset=6                                               \
                 blur_radius=0                                            \
                 position=top                                             \
                 padding_left=0                                           \
                 padding_right=0                                          \
                 color=$nil                                               \
                 font_smoothing=0                                         \

# DEFAULTS

sketchybar --default updates=when_shown                                   \
                     drawing=on                                           \
                     icon.font="${FONT}:Bold:10.0"                        \
                     icon.color=$color7                                   \
                     icon.highlight_color=$background                     \
                     label.font="${FONT}:Normal:12.0"                     \
                     label.color=$color7                                  \
                     label.highlight_color=$background                    \

# LEFT ITEMS

sketchybar                                                                \
  --add item                                                              \
        spacer left                                                       \
  --set spacer                                                            \
        label=""                                                          \
        background.color=$background                                      \
                                                                          \
  --add space                                                             \
        main left                                                         \
  --set main                                                              \
        icon=$SPACE_ICON                                                  \
        associated_space=1                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="$PLUGIN_DIR/space.sh"                                     \
        click_script="yabai -m space --focus main"                        \
                                                                          \
  --add space                                                             \
        social left                                                       \
  --set social                                                            \
        icon=$SPACE_ICON                                                  \
        associated_space=2                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="${PLUGIN_DIR}/space.sh"                                   \
        click_script="yabai -m space --focus social"                      \
                                                                          \
  --add space                                                             \
        browser left                                                      \
  --set browser                                                           \
        icon=$SPACE_ICON                                                  \
        associated_space=3                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="${PLUGIN_DIR}/space.sh"                                   \
        click_script="yabai -m space --focus browser"                     \
                                                                          \
  --add space                                                             \
        code left                                                         \
  --set code                                                              \
        icon=${SPACE_ICON}                                                \
        associated_space=4                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="${PLUGIN_DIR}/space.sh"                                   \
        click_script="yabai -m space --focus code"                        \
                                                                          \
  --add space                                                             \
        terminal left                                                     \
  --set terminal                                                          \
        icon=${SPACE_ICON}                                                \
        associated_space=5                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="${PLUGIN_DIR}/space.sh"                                   \
        click_script="yabai -m space --focus terminal"                    \
                                                                          \
  --add space                                                             \
        media left                                                        \
  --set media                                                             \
        icon=${SPACE_ICON}                                                \
        associated_space=6                                                \
        icon.padding_left=${INNER_PADDING}                                \
        icon.padding_right=$((${PADDING} - 3))                            \
        label.padding_right=${INNER_PADDING}                              \
        background.height=18                                              \
        background.color=$background                                      \
        background.corner_radius=2                                        \
        script="${PLUGIN_DIR}/space.sh"                                   \
        click_script="yabai -m space --focus media"                       \
                                                                          \
  --clone right_spacer spacer                                             \
  --set right_spacer                                                      \

# BRACKETS
sketchybar                                                                \
  --add bracket                                                           \
        spaces_bracket spacer                                             \
                       main                                               \
                       social                                             \
                       browser                                            \
                       code                                               \
                       terminal                                           \
                       media                                              \
                       right_spacer                                       \
  --set spaces_bracket                                                    \
        background.corner_radius=4                                        \
        background.color=0xffff0000                                       \
        background.padding_left=0                                         \
        background.padding_right=0                                        \
                                                                          \
  --add bracket                                                           \
        system_bracket clock                                              \
                       date                                               \
                       battery                                            \
  --set system_bracket                                                    \
        background.corner_radius=4                                        \
        background.color=$background                                      \

edit: I've also noticed a bit of lag between changing spaces using three-finger swipe compared to when sketchybar isn't running -- any thoughts on that?

@FelixKratz FelixKratz added bug Something isn't working available on master labels Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant