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

Pause Plugin Execution - Possible? #934

Open
fm4tt0s opened this issue Feb 18, 2025 · 0 comments
Open

Pause Plugin Execution - Possible? #934

fm4tt0s opened this issue Feb 18, 2025 · 0 comments

Comments

@fm4tt0s
Copy link

fm4tt0s commented Feb 18, 2025

xbar 2.17 beta
MacOS 15.3 Sequoia

I have a .sh plugin running each minute, from times to time it needs to take an action that may take more than 1min. So executions are pilling on top of each other. I've added a lock file handling to it like:

_lock="${_this_path}/lockfile.${_this}.off"
if [[ -f "${_lock}" ]]; then
exit 0
fi

I'm using a 'wait' instruction for the task so it keeps the current run and I can get some output/results out of it:

"${_getInstance}" "${_instanceID}" &
 _pid=$!
wait $_pid
return 0

however, XBar instantiates a new execution whatsoever, obviously. Is there a way to skip an execution if the previous one hasnt finished yet? Or something like it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant