#!/bin/bash

. /usr/bin/fly-tablet-env

#QT_IM_MODULE - Name of virtual keyboard.
#   This property is taken from /usr/share/fly-mobile/vkbd/vkbd.conf.
#   If not empty environment variable will be set.
#   fly-qml-components using this to build root component.

#FLY_LAUNCHER_SETTINGS - Path to launcher QSettings (~/.config/rusbitech/fly-launcher.conf).

#FLY_PHONE_LOW_EFFECTS - If set ColorOverlay will be invisible.
#   Rectangles will be shown instead of shadows. Using 2drenderer sets this value to true.

#FLY_PHONE_DPR - QML scale factor.
#   If not set it will be calculated based on physical dpi or taken from settings.
#   Env value overrides settings value.

#FLY_PHONE_VOLUME_CONTROL - Base amixer simple control.
#   If not set it will be autoset by launcher to Master
#   or Speaker or first control found in amixer scontrols

#FLY_PHONE_KILL_AFTER - Default 3000(ms).
#   When closing windows in pager kill(SIGTERM) is called.
#   And after 3000ms if window(app) still exists then it recieve SIGKILL(unblockable)

#FLY_PHONE_VERBOSE - Verbose mode.

if test -z $QT_IM_MODULE && test -e /usr/share/fly-phone/vkbd/vkbd.conf; then
 export QT_IM_MODULE=`grep QT_IM_MODULE /usr/share/fly-phone/vkbd/vkbd.conf | cut -d "=" -f 2`
fi

if test -x /usr/bin/compton; then
 /usr/bin/compton --config /etc/xdg/compton.fly-mobile.conf &
else
 if test -x /usr/bin/fly-kompmgr; then
  /usr/bin/fly-kompmgr &
 fi
fi

#export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_VIRTUALKEYBOARD_DESKTOP_DISABLE=1

/usr/bin/fly-wm --rcfile $HOME/.fly/ru_RU.UTF-8.fly-wmrc.fly-mobile --execOnly fly-launcher
