2011-07-07 00:52:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
trap "" TERM
|
2010-06-10 20:35:55 +00:00
|
|
|
context=`id -Z | secon -t -l -P`
|
|
|
|
export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`"
|
2011-06-07 12:34:04 +00:00
|
|
|
[ -z $1 ] && export SCREENSIZE="1000x700" || export SCREENSIZE="$1"
|
|
|
|
[ -z $2 ] && export DPI="96" || export DPI="$2"
|
2010-06-10 20:35:55 +00:00
|
|
|
trap "exit 0" HUP
|
|
|
|
|
2013-10-09 21:26:41 +00:00
|
|
|
mkdir -p ~/.config/openbox
|
|
|
|
cat > ~/.config/openbox/rc.xml << EOF
|
|
|
|
<openbox_config xmlns="http://openbox.org/3.4/rc"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<applications>
|
|
|
|
<application class="*">
|
|
|
|
<decor>no</decor>
|
|
|
|
<desktop>all</desktop>
|
|
|
|
<maximized>yes</maximized>
|
|
|
|
</application>
|
|
|
|
</applications>
|
|
|
|
</openbox_config>
|
|
|
|
EOF
|
|
|
|
|
2012-06-25 13:35:53 +00:00
|
|
|
(/usr/bin/Xephyr -title "$TITLE" -terminate -screen $SCREENSIZE -dpi $DPI -nolisten tcp -displayfd 5 5>&1 2>/dev/null) | while read D; do
|
2010-06-10 20:35:55 +00:00
|
|
|
export DISPLAY=:$D
|
2011-08-10 21:22:41 +00:00
|
|
|
cat > ~/seremote << __EOF
|
|
|
|
#!/bin/sh
|
|
|
|
DISPLAY=$DISPLAY "\$@"
|
|
|
|
__EOF
|
|
|
|
chmod +x ~/seremote
|
|
|
|
/usr/share/sandbox/start $HOME/.sandboxrc
|
2010-06-10 20:35:55 +00:00
|
|
|
export EXITCODE=$?
|
2011-07-07 00:52:38 +00:00
|
|
|
kill -TERM 0
|
2010-06-10 20:35:55 +00:00
|
|
|
break
|
|
|
|
done
|
|
|
|
exit 0
|