#!/bin/sh

. /etc/sysconfig/i18n

# Turn the screen saver functions off.
xset s off
xset -dpms ||:

if [ -f /etc/X11/Xresources ]; then
	# Strip directives which require cpp.
	sed -i '/[[:space:]]*#/d' /etc/X11/Xresources
	# Merge resources.
	xrdb -nocpp -merge /etc/X11/Xresources
fi

# Stop services interfering to alterator-wizard.
killall console-kit-daemon

if grep -q vnc /proc/cmdline && grep -qv headless /proc/cmdline; then
	alterator-vnc &
fi

exec alterator-wizard
