#!/bin/sh
# A desktop session around the given command, so Firefox sees what it would on an ordinary Ubuntu desktop:
# a 1920x1080 screen, a window manager with a top bar (like GNOME's) that maximizes Firefox, and a sound
# server with an output device.
set -e
export DISPLAY=:99
Xvfb :99 -screen 0 1920x1080x24 -nolisten tcp >/dev/null 2>&1 &
while [ ! -e /tmp/.X11-unix/X99 ]; do sleep 0.1; done
jwm >/dev/null 2>&1 &
pulseaudio --start --exit-idle-time=-1 >/dev/null 2>&1 || true
exec "$@"
