File fcitx5-lotus.install of Package fcitx5-lotus

all_off='\e[1;0m'
bold='\e[1;1m'
blue='\e[1;34m'
green='\e[1;32m'

post_install() {
    echo -e "${blue}--- Cấu hình Bộ gõ Lotus ---${all_off}"
    
    modprobe uinput
    udevadm control --reload-rules
    udevadm trigger
    
    echo -e "${bold}Hướng dẫn sau cài đặt:${all_off}"
    echo -e "1. Kích hoạt Server cho user của bạn:"
    echo -e "   ${blue}sudo systemctl enable --now fcitx5-lotus-server@\$(whoami).service${all_off}"
    echo ""
    echo -e "2. Cấu hình Fcitx5:"
    echo -e "   - Mở 'Fcitx5 Configuration', thêm bộ gõ ${green}Lotus${all_off}."
    echo ""
    echo -e "3. Lưu ý cho Wayland (KDE):"
    echo -e "   - Hãy chọn 'Fcitx 5' trong phần Virtual Keyboard của hệ thống."
    echo "------------------------------------------------"
}

post_upgrade() {
    post_install
}

pre_remove() {
    echo -e "${blue}--- Đang gỡ bỏ Lotus Services ---${all_off}"
}

post_remove() {
    if id "uinput_proxy" &>/dev/null; then
        userdel uinput_proxy
        echo -e "${green}  -> Đã xóa user uinput_proxy.${all_off}"
    fi
    echo -e "${blue}Fcitx5-Lotus đã được gỡ bỏ sạch sẽ.${all_off}"
}
openSUSE Build Service is sponsored by