summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc')
-rwxr-xr-xcore/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc
index f5ef0223..55ecc254 100755
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/90_runscript.inc
@@ -1,3 +1,11 @@
+function wait_for_wm()
+{
+ # This just waits until there's a window manager.
+ while [[ "$(DISPLAY=:0.0 XAUTHORITY=${XAUTHORITY} xprop -root _NET_SUPPORTING_WM_CHECK)" =~ "no such atom" ]]; do
+ sleep 2
+ done
+}
+
function runscript()
{
logger "openslx: runscript: looking for a script to run..."
@@ -27,19 +35,16 @@ function runscript()
1) # 1=normal
logger "openslx utility: runscript: Starting script maximised."
get_xauthfile
+ wait_for_wm
DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART xterm "$DISKMOUNTDIR/runscript${SCRIPTEXT}" &
;;
2) # 2=minimized (xterm -iconic)
logger "openslx utility: runscript: starting script minimised."
get_xauthfile
-
- # warte auf Window manager...
- while [[ "$(DISPLAY=:0.0 XAUTHORITY=${XAUTHORITY} xprop -root _NET_SUPPORTING_WM_CHECK)" =~ "no such atom" ]]; do
- sleep 2
- done
+ wait_for_wm
# Truly not the best way to wait until the desktop environment is ready, but there's no common way to
- # check for DE readyness. Until then, we'll sleep.
+ # check for DE readiness. Until then, we'll sleep.
sleep 20
DISPLAY=:0.0 XAUTHORITY="${XAUTHORITY}" $USERPART xterm -iconic "$DISKMOUNTDIR/runscript${SCRIPTEXT}" &