#!/usr/bin/env sh

# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(which sxmo_common.sh)"

#Make dbus session available
echo "$DBUS_SESSION_BUS_ADDRESS" > "$CACHEDIR"/dbus.bus

# Force audio over the main speaker
# and set a sane default volume
sxmo_audioout.sh Speaker
amixer sset 'Line Out Source' 'Mono Differential','Mono Differential'
amixer set "Line Out" 75%

# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &

# Start the desktop widget (e.g. clock)
sxmo_hooks.sh desktop_widget &

# Enable automatic screen off and crust when phone is locked and idle
sxmo_lock_idle.sh &

if [ -f "$HOME"/.mms/modemmanager/mms ]; then
	mmsdtng &
fi
