From a7b8122df9e727835cf5171baf2f4cff3128b64e Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Thu, 30 May 2024 23:42:53 +0200 Subject: [PATCH] Export dbus address for the notification server Only screenshare script requires as of today, but put it in webcam also for future proof as it doesn't cause any harm. Assigning variable and declaration made separate due to ShellCheck warning SC2155. For: https://github.com/QubesOS/qubes-issues/issues/6426 Fixes: https://github.com/QubesOS/qubes-issues/issues/8457 Fixes: https://github.com/QubesOS/qubes-video-companion/issues/15 --- qubes-rpc/services/qvc.ScreenShare | 6 ++++-- qubes-rpc/services/qvc.Webcam | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/qubes-rpc/services/qvc.ScreenShare b/qubes-rpc/services/qvc.ScreenShare index 6878f05..b67aa42 100755 --- a/qubes-rpc/services/qvc.ScreenShare +++ b/qubes-rpc/services/qvc.ScreenShare @@ -1,7 +1,9 @@ #!/bin/sh -- - # Copyright (C) 2021 Elliot Killick # Copyright (C) 2021 Demi Marie Obenour # Licensed under the MIT License. See LICENSE file for details. -export DISPLAY=:0 +set -eu +true "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" +true "${DBUS_SESSION_BUS_ADDRESS:="unix:path=${XDG_RUNTIME_DIR}/bus"}" +export DISPLAY=:0 XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS exec python3 -- /usr/share/qubes-video-companion/sender/screenshare.py diff --git a/qubes-rpc/services/qvc.Webcam b/qubes-rpc/services/qvc.Webcam index 7878428..8f66f6f 100755 --- a/qubes-rpc/services/qvc.Webcam +++ b/qubes-rpc/services/qvc.Webcam @@ -1,7 +1,9 @@ #!/bin/sh -- - # Copyright (C) 2021 Elliot Killick # Copyright (C) 2021 Demi Marie Obenour # Licensed under the MIT License. See LICENSE file for details. -export DISPLAY=:0 -exec python3 -- /usr/share/qubes-video-companion/sender/webcam.py ${1:+"$1"} +set -eu +true "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" +true "${DBUS_SESSION_BUS_ADDRESS:="unix:path=${XDG_RUNTIME_DIR}/bus"}" +export DISPLAY=:0 XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS +exec python3 -- /usr/share/qubes-video-companion/sender/webcam.py "${1:+"$1"}"