example: Wait a bit before ending

feedbackd terminates feedback when clients disconnect from DBus so
we need to wait a bit before quitting as otherwise no feedback will
be played.

Closes: #65
This commit is contained in:
Guido Günther
2022-12-03 12:42:41 +00:00
committed by Guido Gunther
parent 3206976a4a
commit 254bf944eb
+4
View File
@@ -3,9 +3,13 @@
# export GI_TYPELIB_PATH=/usr/local/lib/x86_64-linux-gnu/girepository-1.0/ # export GI_TYPELIB_PATH=/usr/local/lib/x86_64-linux-gnu/girepository-1.0/
import gi import gi
import time
gi.require_version('Lfb', '0.0') gi.require_version('Lfb', '0.0')
from gi.repository import Lfb from gi.repository import Lfb
Lfb.init('org.sigxcpu.lfbexample') Lfb.init('org.sigxcpu.lfbexample')
event = Lfb.Event.new('phone-incoming-call') event = Lfb.Event.new('phone-incoming-call')
event.trigger_feedback() event.trigger_feedback()
# feedbackd terminates feedback from clients that disconnect from DBus to avoid
# feedback not being stopped. So wait a bit before quitting:
time.sleep(3)