#!/bin/sh
set -e

# install.sh says what to do next itself.
if [ "$1" = "configure" ] && [ -z "${NGOSEN_INSTALLER:-}" ]; then
    echo "--- Cấu hình Ngó Sen ---"
    # KWin starts fcitx5 itself there, and one started with fcitx5 -rd cannot serve Qt apps.
    kde_wayland=0
    pgrep -x kwin_wayland >/dev/null 2>&1 && kde_wayland=1
    if [ -z "$2" ]; then
        echo "Mở 'Fcitx5 Configuration' và thêm bộ gõ Ngó Sen."
        if [ "$kde_wayland" -eq 1 ]; then
            echo "KDE Wayland: chọn 'Fcitx 5' trong System Settings → Virtual Keyboard."
        fi
    elif [ "$kde_wayland" -eq 1 ]; then
        echo "Đăng xuất rồi đăng nhập lại để dùng bản mới."
    else
        echo "Khởi động lại fcitx5 để dùng bản mới: fcitx5 -rd"
    fi
fi

#DEBHELPER#

exit 0
