-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Animation System #148
Comments
hi there @FelixKratz. from what I have going on in my configuration right now, this is what i have for an animation-esque charging animation: items/system.sh#!/bin/bash
CHARGING=$(pmset -g batt | grep 'AC Power')
if [[ ${CHARGING} != "" ]]; then
BATT_SCRIPT="$PLUGIN_DIR/charging.sh"
BATT_ICON_SIZE="$FONT:Regular:26.0"
else
BATT_SCRIPT="$PLUGIN_DIR/battery.sh"
BATT_ICON_SIZE="$FONT:Regular:13.0"
fi
sketchybar --clone system.label label_template \
--set system.label label=sys \
label.align=center \
position=left \
drawing=on \
script="$PLUGIN_DIR/window_title.sh" \
--subscribe system.label front_app_switched \
\
--add item battery left \
--set battery update_freq=100 \
script="$BATT_SCRIPT" \
icon.font="$BATT_ICON_SIZE" \
label.font="$FONT:Bold Italic:14.0" \
background.height=$SEGMENT_HEIGHT \
label.padding_right=0 \
\
--add item system.caffeinate left \
--set system.caffeinate update_freq=100 \
icon=$LOADING \
label.drawing=off \
script="$PLUGIN_DIR/caffeinate.sh" \
--subscribe system.caffeinate mouse.clicked \
\
--add item system.yabai_float left \
--set system.yabai_float script="$PLUGIN_DIR/yabai_float.sh" \
label.drawing=off \
updates=on \
--subscribe system.yabai_float front_app_switched window_focus mouse.clicked\
\
--add bracket system \
system.label \
battery \
system.caffeinate \
system.yabai_float \
\
--set system background.drawing=on plugins/battery.sh#!/bin/bash
BATT_PERCENT=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
CHARGING=$(pmset -g batt | grep 'AC Power')
sketchybar --set ${NAME} icon.color=0xff2d2a2e
case ${BATT_PERCENT} in
100) ICON="" ;;
9[0-9]) ICON="" ;;
8[0-9]) ICON="" ;;
7[0-9]) ICON="" ;;
6[0-9]) ICON="" ;;
5[0-9]) ICON="" ;;
4[0-9]) ICON="" ;;
3[0-9]) ICON="" ;;
2[0-9]) ICON="" ;;
1[0-9]) ICON="" ;;
*) ICON=""
esac
sketchybar --set ${NAME} icon="${ICON}"
sketchybar --set ${NAME} label="${BATT_PERCENT}%" plugins/charging.sh#!/bin/bash
BATT_PERCENT=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
CHARGING=$(pmset -g batt | grep 'AC Power')
sketchybar --set ${NAME} icon.color=0xff2d2a2e
while [[ ${CHARGING} != "" ]]; do
sketchybar --set ${NAME} label="${BATT_PERCENT}%"
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
sleep .5
sketchybar --set ${NAME} icon=""
done
thanks to @ut0mt8 for the code in this comment. i know this is separate from the implementation you are describing, but i found this to be a related enough topic to share for anyone else looking at this. it required a nerdfont to be installed, but something like this where the trigger between charging/not charging changing how an element on the bar looks is exactly what this sort of thing would be great for, as well as the bar itself being responsive/animating. tl;dr: a big upvote for this feature! |
I have achieved a first implementation of the animation system (d440b00) and implemented it for the The experimental (and undocumented) syntax for those that want to try the animation system early is: sketchybar --animate <curve> <steps> --bar <property>=<value> ... <property>=<value> so basically, the Please tell me what you think about this implementation. E.g. try: sketchybar --animate linear 50 --bar y_offset=20 margin=10 blur_radius=30 |
Since f71192c the animation.mp4Next steps for this are:
|
Since 4bb1b51 all |
awesome work! |
Since 9eeacd3 all color transitions can be animated, e.g. for a space switching animation like this: animation.mp4 |
I imagine a system where selected properties could be modified exactly as in the
--set
domain, but with aduration
and an easingfunction
. The syntax would look something like this:where sketchybar would animate the transition from the current values to the
final value
s with the given animation parametery by interpolating between them with the easingfunction
.This would work well for colors and coordinates (y_offset, paddings, etc...) I think.
I would likely hard code some nice easing functions, such as a truncated exponential or a truncated tanh etc..
Are there additional ideas I should take into consideration while designing this?
The text was updated successfully, but these errors were encountered: