-
-
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.
Merge remote-tracking branch 'origin/pr/24'
* origin/pr/24: Allow monitor choice
- Loading branch information
Showing
4 changed files
with
51 additions
and
14 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 |
---|---|---|
|
@@ -2,8 +2,30 @@ | |
# 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"}" | ||
export DISPLAY=:0 XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS | ||
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
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