#!/bin/sh

PREREQ=""
DESCRIPTION="Setting up plasma-mobile settings"

prereqs()
{
       echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
       prereqs
       exit 0
       ;;
esac

. /scripts/casper-functions

log_begin_msg "$DESCRIPTION"

# We override the setup created by 40kde_neon_setup to login to phablet user and use plasma-mobile
if [ -f /root/usr/bin/sddm ]; then
    cat << EOF > /root/etc/sddm.conf
[Users]
MinimumUid=999

[Autologin]
User=neon
Session=plasma-mobile.desktop
Relogin=true

[Theme]
Current=breeze
CursorTheme=breeze_cursors

[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

[Wayland]
CompositorCommand=kwin_wayland --no-lockscreen
#CompositorCommand=kwin_wayland --no-lockscreen --inputmethod maliit-keyboard
EOF
fi

file=/root/usr/share/applications/calamares.desktop
sed -i 's/sudo/pkexec/' $file

log_end_msg

