Home | History | Annotate | Download | only in sandbox
      1 #!/bin/bash
      2 trap "" TERM
      3 context=`id -Z | secon -t -l -P`
      4 export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`"
      5 [ -z $1 ] && export SCREENSIZE="1000x700" || export SCREENSIZE="$1"
      6 [ -z $2 ] && export DPI="96" || export DPI="$2"
      7 trap "exit 0" HUP
      8 
      9 mkdir -p ~/.config/openbox
     10 cat > ~/.config/openbox/rc.xml << EOF
     11 <openbox_config xmlns="http://openbox.org/3.4/rc"
     12 		xmlns:xi="http://www.w3.org/2001/XInclude">
     13 <applications>
     14   <application class="*">
     15     <decor>no</decor>
     16     <desktop>all</desktop>
     17     <maximized>yes</maximized>
     18   </application>
     19 </applications>
     20 </openbox_config>
     21 EOF
     22 
     23 (/usr/bin/Xephyr -resizeable -title "$TITLE" -terminate -screen $SCREENSIZE -dpi $DPI -nolisten tcp -displayfd 5 5>&1 2>/dev/null) | while read D; do
     24     export DISPLAY=:$D
     25     cat > ~/seremote << __EOF
     26 #!/bin/sh
     27 DISPLAY=$DISPLAY "\$@"
     28 __EOF
     29     chmod +x ~/seremote
     30     /usr/share/sandbox/start $HOME/.sandboxrc
     31     export EXITCODE=$?
     32     kill -TERM 0
     33     break
     34 done
     35 exit 0
     36