Closed aspauldingcode closed 4 months ago
it might be more of: how do I do this? before triggering the popup, I want it to check for 2 seconds (in case I move the mouse away, it should instead not popup). If I hold on the item for 2 seconds, and after 2 seconds I am still hovering, then it would know I'm expecting a popup and it will set popup drawing on.
these are events that trigger the instant they happen, so it you won't get if the mouse is on the item afterwards. You can consider doing something like this:
# on the entered event
rm /tmp/sk_exited_"$NAME"
(
sleep 2
[[ -f /tmp/sk_exited_"$NAME" ]] || sketchybar --set $NAME popup.drawing=on
) &
# on the exited event
touch /tmp/sk_exited_"$NAME"
With this, exit events set a flag, so you can read that 2 seconds after the enter event to know if your cursor is still didn't exit.
Maybe there's a more straightforward way of doing it, but idk
Having issues keeping my popup drawing set as off when mouse has exited the
apple
item. in my apple.sh:I wanted to add a nested if statement which double checks after 2 seconds if I am still hovered on the item, before setting the popup drawing=on.
However, the code above doesn't do this, because if I add the nested for loop it seems to still think it's hovered. I'm not exactly sure how to approach this.