From 0c049cf3cb2adde76abe46f8cde692b841cf95e7 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jan 2020 13:25:45 +0100 Subject: [run-virt/vbox-src] initial multi-monitor support --- .../run-virt-includes/set_runvirt_hardware_variables.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc index 414c654a..91577f71 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc @@ -151,6 +151,15 @@ set_serial_ports() { readonly SERIAL0 PARALLEL0 } +get_display_count() { + declare -g DISPLAY_COUNT="$(xrandr | grep -c -w 'connected')" + if ! [[ "$DISPLAY_COUNT" =~ ^[1-9]$ ]]; then + writelog "Weird monitor count detected ($DISPLAY_COUNT). Falling back to 1." + DISPLAY_COUNT=1 + fi + readonly DISPLAY_COUNT +} + ## MAIN ## call_post_source \ import_hwinfo \ @@ -158,5 +167,6 @@ call_post_source \ set_virt_mac \ set_virt_hostname \ set_serial_ports \ - check_optical_drives + check_optical_drives \ + get_display_count -- cgit v1.2.3-55-g7522