-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
run_kalendar.sh
30 lines (24 loc) · 934 Bytes
/
run_kalendar.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# Use custom instance to avoid clash with stable or
# system-wide instance
export AKONADI_INSTANCE="flatpak-nightly-kalendar"
function stop_akonadi {
local akonadictl="akonadictl --instance=${AKONADI_INSTANCE}"
${akonadictl} stop
while [[ $({$akonadictl} status 2>&1 | grep "running") ]]; do
sleep 1
done
}
# Make sure we run against our own Akonadi instance
stop_akonadi
# Make sure that our Akonadi is stopped when this script exits, as there
# is no way to shut it down later and it would interfere with the next run.
trap stop_akonadi EXIT
# Kalendar requires that ksycoca cache exists, but cannot run kbuildsycoca5
# automatically (because KDED lives outside of the sandbox).
# As a workaround we force-run it ourselves. It's really only needed once,
# but detecting whether it already exists or not is hard and the overhead
# is minimal.
kbuildsycoca5
# .. aaaaand lift-off
kalendar "$@"