-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If more than one monitor is found on the target, an interactive dialog will be prompted to the user to choose from, displaying monitor name (port) and resolution and geometry for better identification. The monitor can be enforced by the target by environment variable. Fixes: QubesOS/qubes-issues#9275
- Loading branch information
1 parent
6246500
commit 14ffef1
Showing
5 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
#!/bin/sh -- | ||
|
||
# Copyright (C) 2021 Elliot Killick <[email protected]> | ||
# Copyright (C) 2021 Demi Marie Obenour <[email protected]> | ||
# Licensed under the MIT License. See LICENSE file for details. | ||
|
||
set -eu | ||
|
||
## DISPLAY variable used by: xrandr, zenity | ||
export DISPLAY=:0 | ||
|
||
true "${XDG_RUNTIME_DIR:="/run/user/$(id -u)"}" | ||
true "${DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"}" | ||
monitors="$(xrandr --listactivemonitors \ | ||
| awk '/^ [0-9]+: \+/ { print "FALSE", $4, $3 }')" | ||
monitor_count="$(echo "${monitors}" | wc -l)" | ||
monitor_longest_line="$(echo "${monitors}" | wc -L)" | ||
dialog_height="$((monitor_count*50+60))" | ||
dialog_width="$((monitor_longest_line*10))" | ||
if test "${monitor_count}" -gt 1; then | ||
# shellcheck disable=SC2086 | ||
QVC_MONITOR="$(zenity --list --radiolist \ | ||
--height="${dialog_height}" --width="${dialog_width}" \ | ||
--column "ID" --column "Name" --column "Resolution" \ | ||
--title "Screen share" \ | ||
--text "Select monitor to present to qube ${QREXEC_REMOTE_DOMAIN}" \ | ||
${monitors})" | ||
fi | ||
true "${QVC_MONITOR:=}" | ||
|
||
export XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS QVC_MONITOR | ||
exec python3 -- /usr/share/qubes-video-companion/sender/screenshare.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/bin/sh -- | ||
|
||
# Copyright (C) 2021 Elliot Killick <[email protected]> | ||
# Copyright (C) 2021 Demi Marie Obenour <[email protected]> | ||
# 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"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters