#!/bin/sh

export LD_LIBRARY_PATH=/usr/lib/openssl-1.1.1k:/usr/lib:/usr/local/share/app/lib:/usr/lib/qt-5.15.2/lib
export XDG_RUNTIME_DIR=/run
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt-5.15.2/plugins
export QT_QPA_FONTDIR=/usr/lib/qt-everywhere-5.15.2/lib/fonts
export QT_LIBDIR_EGL=/usr/lib
export QT_LIBDIR_GLES2=/usr/lib

export FONTCONFIG_FILE=/usr/lib/qt-5.15.2/lib/fonts/fonts.conf
export FONTCONFIG_PATH=/usr/lib/qt-5.15.2/lib/fonts/

export QT_QPA_PLATFORM=wayland

#export QT_QPA_EGLFS_DEBUG=1
#export QT_DEBUG_PLUGINS=1
#export QT_LOGGING_RULES="qt.*=true"
export WESTEROS_GL_ALWAYS_PLATFORM_DISPLAY=1



export WAYLAND_DISPLAY=infomir-shell
export WESTEROS_GL_GRAPHICS_MAX_SIZE=1920x1080
export WESTEROS_GL_USE_AMLOGIC_AVSYNC=1
export WESTEROS_GL_REFRESH_PRIORITY=F,80
export WESTEROS_SINK_AMLOGIC_USE_DMABUF=1
export WESTEROS_SINK_USE_FREERUN=1
export WESTEROS_SINK_USE_ESSRMGR=1
export WESTEROS_GL_USE_REFRESH_LOCK=1
export ESSOS_NO_EVENT_LOOP_THROTTLE=1
export AVPK_SKIP_HDMI_VALIDATION=1
export QT_WAYLAND_SHELL_INTEGRATION=xdg-shell

#turning off vertical align on qcombobox
export QT_INFOMIR_IGNORE_POPUP_ALIGN=1


#mkdir -p /ram && cp /usr/local/share/app/info.txt  /ram
/usr/local/share/app/bin/info.sh > /ram/info.txt

echo 4 > /proc/sys/kernel/printk

# Switch OFF IR INPUT device and activate IR RAW READER
# Stbapp require only RAW READER enabled
if [ -f /sys/devices/virtual/remote/amremote/use_reader ] ; then
	echo 0 > /sys/devices/virtual/remote/amremote/use_input
	echo 1 > /sys/devices/virtual/remote/amremote/use_reader
fi
