1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh
# Launch a nested session inside FVWM-Crystal using Xephyr
# Syntax: launchwm $[vp.width] $[vp.height] $[infostore.Your_Id] <wm>
# next free $DISPLAY, needed for nested wm in nested wm :)
XephyrDisplay=$((`echo $DISPLAY|cut -d: -f2|cut -d. -f1`+1))
# nested session dimension; you can change it
#XephyrWidth=$((`echo $(($1-200))`))
#XephyrHeight=$((`echo $(($2-100))`))
XephyrWidth=$1
XephyrHeight=$2
EXECWM=`grep Exec $4 | grep -v Try | sed -e 's:Exec=::'`
# launch Xephyr
Xephyr -ac -reset -title `basename $EXECWM` -screen "$XephyrWidth"x"$XephyrHeight" :$XephyrDisplay &
XEPHYR_PID=`echo $!`
# wait and bring Xephyr in full screen
sleep 0.2
FvwmCommand "All (Xephyr) Fullscreen-Start"
# launch the wm
# We dont want the fvwm and fvwm-themes files to be mixed with fvwm-crystal
ENVWM=`basename $EXECWM`
if [ "$ENVWM" = "fvwm-themes-start" ] ; then
FVWM_USERDIR="/home/$3/.fvwm" DISPLAY=:$XephyrDisplay $EXECWM 2>/dev/null
else
if [ "$ENVWM" = "fvwm" ] ; then
FVWM_USERDIR="/home/$3/.fvwm" DISPLAY=:$XephyrDisplay $EXECWM 2>/dev/null
else
DISPLAY=:$XephyrDisplay $EXECWM 2>/dev/null
fi
fi
# stop Xephyr
FvwmCommand "All (Xephyr) Fullscreen-Stop"
sleep 0.2
kill $!
|