pgaskin / NickelMenu

The easiest way to launch scripts, change settings, and run actions on Kobo e-readers.
https://pgaskin.net/NickelMenu
MIT License
590 stars 32 forks source link

Dependencies with cmd_spawn #129

Open dgsiegel opened 2 years ago

dgsiegel commented 2 years ago

I do have a configuration like this:

menu_item :library  :Foobar  :cmd_spawn       :quiet:/mnt/onboard/.adds/foobar.sh
  chain_success :dbg_toast :Done

The documentation states "By default, each action only executes if the previous one was successful.". Even though it seems that while the foobar script was executed in background, the toast message pops up immediately. Is there a way to let the chain wait until the first script has finished?

I know there is cmd_output, however this script might take longer than 10 seconds on some occasions...

NiLuJe commented 2 years ago

IIRC, no, not with a spawn, you'll want to handle the toast inside your script via NickelDBus ;).

dgsiegel commented 2 years ago

Alright! In that case would it be possible to increase the timeout limit to e.g. 30 seconds? Seems like it's an arbitrary value anyways? https://github.com/pgaskin/NickelMenu/blob/master/src/action_cc.cc#L849

NiLuJe commented 2 years ago

Not really, we can't block safely for (much) more than that without risking the wrath of Nickel's watchdog, which would just kill nickel.

pgaskin commented 2 years ago

Yes, and also, async actions are planned at some point in the future... #105