#!/bin/sh

. install2-sh-functions

locale_conf=/etc/locale.conf
i18n_conf=/etc/sysconfig/i18n
if [ -s "$locale_conf" ]; then
    . "$locale_conf"
elif [ -s "$i18n_conf" ]; then
    . "$i18n_conf"
fi

# Turn the screen saver functions off.
if ! cmdline_has_arg wayland; then
	XSET=xset
	$XSET s off ||:
	$XSET -dpms ||:
fi

if [ -f /etc/X11/Xresources ]; then
	# Strip directives which require cpp.
	sed -i '/[[:space:]]*#/d' /etc/X11/Xresources
	# Merge resources.
	XRDB=xrdb
	$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
	"$install2_bindir"/alterator-vnc &
fi

exec alterator-wizard
