#!/bin/sh
# openbox session: launch tint2 taskbar + chromium, then openbox as WM.
# This file is used as an xinitrc by bee-desktop.

# Wait for bee-web to be accepting connections (up to 15 seconds)
i=0
while [ $i -lt 15 ]; do
    if curl -sf http://localhost/healthz >/dev/null 2>&1; then
        break
    fi
    sleep 1
    i=$((i+1))
done

# Disable screensaver and DPMS
xset s off
xset -dpms
xset s noblank

tint2 &
chromium \
    --disable-infobars \
    --disable-translate \
    --no-first-run \
    --disable-session-crashed-bubble \
    --disable-features=TranslateUI \
    --start-fullscreen \
    http://localhost/ &

exec openbox
