summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
diff options
context:
space:
mode:
authorJonathan Bauer2020-01-16 13:25:45 +0100
committerJonathan Bauer2020-01-16 13:25:45 +0100
commit0c049cf3cb2adde76abe46f8cde692b841cf95e7 (patch)
tree76df7125938afdd003164dde2627a1b836984fed /core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
parent[pam-slx-plug] fix exec_auth_final always exiting (diff)
downloadmltk-0c049cf3cb2adde76abe46f8cde692b841cf95e7.tar.gz
mltk-0c049cf3cb2adde76abe46f8cde692b841cf95e7.tar.xz
mltk-0c049cf3cb2adde76abe46f8cde692b841cf95e7.zip
[run-virt/vbox-src] initial multi-monitor support
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc12
1 files changed, 11 insertions, 1 deletions
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