diff --git a/anda/others/kwin-system76-scheduler-integration/com.system76.Scheduler.dbusproxy.service b/anda/others/kwin-system76-scheduler-integration/com.system76.Scheduler.dbusproxy.service index 2bb6ec3048..b2943dbf89 100644 --- a/anda/others/kwin-system76-scheduler-integration/com.system76.Scheduler.dbusproxy.service +++ b/anda/others/kwin-system76-scheduler-integration/com.system76.Scheduler.dbusproxy.service @@ -1,5 +1,7 @@ [Unit] Description=Forward com.system76.Scheduler session DBus messages to the system bus +StartLimitIntervalSec=60 +StartLimitBurst=5 [Service] ExecStart=/usr/local/bin/system76-scheduler-dbus-proxy.sh diff --git a/anda/others/kwin-system76-scheduler-integration/system76-scheduler-dbus-proxy.sh b/anda/others/kwin-system76-scheduler-integration/system76-scheduler-dbus-proxy.sh index e03e92726c..850f5612e8 100644 --- a/anda/others/kwin-system76-scheduler-integration/system76-scheduler-dbus-proxy.sh +++ b/anda/others/kwin-system76-scheduler-integration/system76-scheduler-dbus-proxy.sh @@ -1,11 +1,14 @@ #!/bin/bash + +set -euo pipefail + DBUS_SERVICE="com.system76.Scheduler" DBUS_PATH="/com/system76/Scheduler" DBUS_INTERFACE="com.system76.Scheduler" DBUS_METHOD="SetForegroundProcess" -dbus-monitor "destination=$DBUS_SERVICE,path=$DBUS_PATH,interface=$DBUS_INTERFACE,member=$DBUS_METHOD" | - while true; do - read method call time sender _ dest serial path interface member - read type pid - [ "$member" = "member=$DBUS_METHOD" ] && qdbus --system $DBUS_SERVICE $DBUS_PATH $DBUS_INTERFACE.$DBUS_METHOD $pid - done + +while true; do + read method call time sender _ dest serial path interface member + read type pid + [ "$member" = "member=$DBUS_METHOD" ] && qdbus --system $DBUS_SERVICE $DBUS_PATH $DBUS_INTERFACE.$DBUS_METHOD $pid +done < <(dbus-monitor "destination=$DBUS_SERVICE,path=$DBUS_PATH,interface=$DBUS_INTERFACE,member=$DBUS_METHOD")