File indexing completed on 2024-03-24 16:47:06

0001 #!/bin/sh
0002 
0003 # Use custom instance to avoid clash with stable or
0004 # system-wide instance
0005 export AKONADI_INSTANCE="flatpak-nightly-kalendar"
0006 
0007 function stop_akonadi {
0008     local akonadictl="akonadictl --instance=${AKONADI_INSTANCE}"
0009     ${akonadictl} stop
0010     while [[ $({$akonadictl} status 2>&1 | grep "running") ]]; do
0011         sleep 1
0012     done
0013 }
0014 
0015 # Make sure we run against our own Akonadi instance
0016 stop_akonadi
0017 
0018 # Make sure that our Akonadi is stopped when this script exits, as there
0019 # is no way to shut it down later and it would interfere with the next run.
0020 trap stop_akonadi EXIT
0021 
0022 # Kalendar requires that ksycoca cache exists, but cannot run kbuildsycoca5
0023 # automatically (because KDED lives outside of the sandbox).
0024 # As a workaround we force-run it ourselves. It's really only needed once,
0025 # but detecting whether it already exists or not is hard and the overhead
0026 # is minimal.
0027 kbuildsycoca5
0028 
0029 # .. aaaaand lift-off
0030 kalendar "$@"