#!/usr/bin/env sh xephyr=$1 awesome=$2 rc_file=$3 # Check for the first free $DISPLAY for ((i=1;;i++)); do if [[ ! -f "/tmp/.X${i}-lock" ]]; then D=$i; break; fi; done # Start Xephyr $xephyr :$D -name xephyr_$D -ac -br -noreset -screen 1600x900 >/dev/null 2>&1 & sleep 1 # Start Awesome DISPLAY=:$D.0 $awesome \ --config $rc_file