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

System Menu does not wait for shell script to finish before rendering #64

Closed
GastroGeek opened this issue Feb 23, 2016 · 5 comments
Closed

Comments

@GastroGeek
Copy link

Problem:
I have a script that does a whole bunch of things and I need to see a long list of results in the menu item (say 8-10 items). However, it intermittently shows differing numbers of items on every mouse click.

Example code (Reproduce):

#!/bin/bash

echo "ITEM_001"
echo "ITEM_002"
echo "ITEM_003"
echo "ITEM_004"
echo "ITEM_005"
echo "ITEM_006"
echo "ITEM_007"
echo "ITEM_008"
echo "ITEM_009"

Steps
Set up a bog standard menu app. Add this for the script (bash) and run.

Once running, repeatedly click the menu. It shows any random number of items, depending on how much of the script is executed, before rendering.

System:
El Capitan, Mac Mini, Dual Monitors.

Thinking aloud:
I did once try 'hacking' the code (I don't do xcode/objc)... seems there needs to be a check for when the processes have finished. Or... is there a way it could perhaps show a spinning progress and only update once all data has been returned? I realise this may be a tricky one due to the way OSX works but it really would make this a killer app! (well, OK it already is a killer app but yeah).

Keep it up and thanks!

@johnhcc
Copy link

johnhcc commented Mar 22, 2016

Whatever is causing this issue might be responsible for #53 as well...

@pirate
Copy link

pirate commented Apr 20, 2016

This workaround has been working great for me so far:

# add at the end of your script
sleep 0.1

Obviously not ideal since it causes a slight delay when clicking, but it's short enough to not annoy me so far.

@sveinbjornt
Copy link
Owner

I've discovered what's causing this but haven't gotten around to fixing it. Soon!

sveinbjornt added a commit that referenced this issue Feb 24, 2017
@sveinbjornt
Copy link
Owner

Now fixed in master.

@pirate
Copy link

pirate commented Feb 24, 2017

Awesome, thanks @sveinbjornt!

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

4 participants