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
Flickering on items with scrolling text enabled #507
Comments
One thing to add is that I've tried without the |
I am not able to reproduce on macOS sonoma with this minimal config:
#!/bin/zsh
SCRIPT='
#!/bin/sh
PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
TIME_LEFT=$(pmset -g batt | grep -Eo "\d+:\d+")
CHARGING=$(pmset -g batt | grep "AC Power")
CALCULATED_TIME="..."
if [ $PERCENTAGE = "" ]; then
exit 0
fi
case ${PERCENTAGE} in
9[0-9]|100) ICON=""
;;
[6-8][0-9]) ICON=""
;;
[3-5][0-9]) ICON=""
;;
[1-2][0-9]) ICON=""
;;
*) ICON=""
esac
if [[ $CHARGING != "" ]]; then
ICON=""
fi
if [[ -z $TIME_LEFT ]]; then
echo "Remaining time: $TIME_LEFT"
TIME_LABEL="--:--"
else
TIME_LABEL=$TIME_LEFT
fi
sketchybar --set $NAME label.width=42 label.max_chars=5 scroll_texts=true label.align=center icon="$ICON" label="$TIME_LABEL $PERCENTAGE%"
'
sketchybar --bar color=0xff000000 sticky=off topmost=window
sketchybar --add item battery right \
--set battery label.font.size=13.0 \
script="$SCRIPT" \
update_freq=120 \
--subscribe battery system_woke power_source_change
sketchybar --update could you confirm that it happens with this exact config as well? Which macOS version are you running? |
I've changed the config and will run it for a while to see if I get the same behavior. As for the macOS version, I'm running Sonoma, version 14.3.1 with 16Gb of RAM. Not sure if relevant, but I switch regularly between a 4k monitor with the MacBook in clamshell mode and the laptop built-in monitor. I got the same behavior in both, but not sure if the change of displays could be triggering something else. |
Bit of an update, I ran the config you posted @FelixKratz and I'm not seeing any other glitch which is good, however, I kinda know now where the issue might be coming from. I've modified the config file you posted and changed the font.size property to this:
With that modification, the issue started again (not immediately but after a few hours of work). Fredoka is this Google Font but I've got this issue also with fonts from NerdFonts. Home that helps to scope the issue a bit more |
I noticed the same thing happening with my music item as well, and I use OperatorMono Nerd Font. Also the texts sometimes seem a bit laggy when it's not flickering. |
I got more replication info today. I was able to get the same behavior with a stripped down version of the config I had (only the item without styles) and I was able to get the same behavior. For this replication, I was able to remove the background, font, and styles from the item, was able to leave only the battery indicator. The only thing I wasn't able to get was to put the bar completely black, not sure if the transparency of the bar is what causing the issue One thing I noticed right away is that the issue was more noticeable when the bar had Screen.Recording.2024-02-27.at.5.05.51.PM.mov |
And tinkering again, I got the same behavior using the config file you posted initially below (adding the position bottom to the bar though). This is the video: With custom font Screen.Recording.2024-02-27.at.5.56.22.PM.movWithout custom font: Screen.Recording.2024-02-27.at.5.59.40.PM.mov
|
Could you try with current master? I think I know why this was happening now: brew uninstall sketchybar
brew install sketchybar --head
brew services restart sketchybar and then to go back to latest stable release use: brew uninstall sketchybar
brew install sketchybar
brew services restart sketchybar My hypthesis would also explain why it is font and position dependent and why I was not able to reproduce it. Because I can still not reproduce it, please confirm if it worked. |
I performed the steps to remove and install from head but unfortunately, the issue still exists. Funny thing, I can see it flicker on my screen but when I try to record it using cmd+shift+5, the bar doesn't do it anymore and works as expected fow a while |
Sometimes (around 40% of the time) I get a weird flickering on items that have scrolling text such as the battery item or the Now Playing item I have.
A restart of the bar clears it most of the time but sometimes it sticks.
Video of the issue:
Screen.Recording.2024-02-16.at.7.59.56.PM.mov
The item file has this:
and the plugin file has the following:
The bar has the following styles and settings:
The text was updated successfully, but these errors were encountered: