Closed santilococo closed 1 year ago
I think it is just hilariously large and thus you cant see it because the circle area begins offscreen, try setting background.image.scale=0.1
.
It would probably be easier to use a font symbol for that in the icon or label and give it an offset.
Thanks a lot!
Hello Felix, I currently have this (with two background images):
But maybe it is not very efficient to read the image every time, isn't it?
I want to ask how can I do it with an icon or label as you recommended. I read the docs but didn't see anything that could help me.
Thanks.
Here is an example how to do something like this with the icon/label:
When creating the spaces like this:
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15")
sid=0
spaces=()
for i in "${!SPACE_ICONS[@]}"
do
sid=$(($i+1))
space=(
associated_space=$sid
icon=${SPACE_ICONS[i]}
icon.padding_left=10
label.font="Hack Nerd Font:Regular:8"
label.y_offset=8
padding_left=2
padding_right=2
icon.highlight_color=$RED
script='sketchybar --set $NAME icon.highlight=$SELECTED'
)
sketchybar --add space space.$sid left \
--set space.$sid "${space[@]}"
done
we set the label
to have a small font and set a y_offset
for it. The space script now only changes the highlight of the icon.
Next, in the function where we check wether there are windows on a space or not we can populate the label with an arbitrary font symbol:
windows_on_spaces () {
CURRENT_SPACES="$(yabai -m query --displays | jq -r '.[].spaces | @sh')"
args=()
while read -r line
do
for space in $line
do
icon_strip=" "
apps=$(yabai -m query --windows --space $space | jq -r ".[].app")
if [ "$apps" != "" ]; then
args+=(--set space.$space label=⬤)
else
args+=(--set space.$space label=◯)
fi
done
done <<< "$CURRENT_SPACES"
sketchybar -m "${args[@]}"
}
The result will look like this, but can be adopted to whatever you wish for (you could swap the role of the icon and label if you want to have the indication on the left of the space for example):
Thanks a lot! That's exactly what I wanted.
Hello, I want to set an icon on the top right corner of the space icon when the space has apps inside it.
Something like this:
I tried this on your
plugins/yabai.sh
windows_on_spaces()
function:Where
full_dot.png
is:But it doesn't seem to work. Do you know if I'm doing something wrong?
(1, 2 and 10 have apps)
Thanks.