#!/bin/sh

## Simple wrapper around Xgl to clean the lockfiles it leaves behind
## when it loses its connection to the underlying Xserver.
##
## Xgl should be fixed to clean up after itself properly.  Then this wrapper
## can go away.

## Wrapper needs to be called with :DISPLAY as first argument, everything else
## is waved through to Xgl

DISPLAYNUM=$(echo $1 | sed s/.*://)
LOCKFILES="/tmp/.X$DISPLAYNUM-lock /tmp/.X11-unix/X$DISPLAYNUM"

Xgl $@

rm $LOCKFILES
