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