vietc/packaging/deb/DEBIAN/postinst
vndangkhoa 16a0d73a6e Viet+ v0.1.0 - Vietnamese Input Method for Linux
Features:
- Direct Input Engine (no pre-edit buffer, no underline)
- Telex + VNI input methods
- Auto-restore English words
- ESC undo (strip tones)
- Smart per-app memory
- Macro expansion (ko→không, dc→được, vs→với, lm→làm)
- Triple backend: uinput, X11 XTEST, Wayland IM
- Hot-reload config
- 148 tests passing

Packaging:
- .deb package
- AppImage support
- AUR PKGBUILD
- Flatpak manifest
- Systemd user service
2026-06-24 10:13:10 +07:00

42 lines
1.1 KiB
Bash

#!/bin/bash
set -e
# Create vinput group for uinput access
if ! getent group vinput > /dev/null 2>&1; then
groupadd -r vinput
fi
# Add root to vinput group (for uinput device access)
usermod -aG vinput root 2>/dev/null || true
# Create config directory
mkdir -p /etc/vietc
if [ ! -f /etc/vietc/config.toml ]; then
cp /usr/share/doc/vietc/config.toml /etc/vietc/config.toml 2>/dev/null || true
fi
# Set uinput device permissions
if [ -e /dev/uinput ]; then
chmod 660 /dev/uinput 2>/dev/null || true
chown root:vinput /dev/uinput 2>/dev/null || true
fi
# Enable lingering for systemd user services
if command -v loginctl &>/dev/null; then
loginctl enable-linger root 2>/dev/null || true
fi
echo ""
echo "Viet+ installed successfully!"
echo ""
echo "Quick start:"
echo " 1. Add your user to the vinput group:"
echo " sudo usermod -aG vinput \$USER"
echo " 2. Log out and back in"
echo " 3. Start the daemon:"
echo " vietc"
echo " 4. Or enable the systemd user service:"
echo " systemctl --user enable --now vietc"
echo ""
echo "Configure: /etc/vietc/config.toml"
echo "Settings UI: vietc-settings (if GTK4 installed)"