summarylogtreecommitdiffstats
path: root/linuxwhisper.install
blob: eee6a3443fa05c2d4e6a8a0ff8260a4ffa04ea65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
post_install() {
    # Auto-setup: load uinput kernel module
    if ! lsmod | grep -q uinput; then
        modprobe uinput 2>/dev/null && echo ":: Loaded uinput kernel module"
    fi

    # Auto-setup: add invoking user to input group
    if [ -n "$SUDO_USER" ]; then
        if ! groups "$SUDO_USER" 2>/dev/null | grep -qw input; then
            usermod -aG input "$SUDO_USER" 2>/dev/null && \
                echo ":: Added $SUDO_USER to input group (log out and back in to apply)"
        fi
    fi

    echo ""
    echo "============================================================"
    echo "  LinuxWhisper — Post-Install Setup"
    echo "============================================================"
    echo ""
    echo "  The following were configured automatically:"
    echo "    - uinput kernel module loaded (persists via modules-load.d)"
    echo "    - User added to input group (log out/in to apply)"
    echo ""
    echo "  Remaining manual steps:"
    echo ""
    echo "  1. Enable ydotool for Wayland text injection:"
    echo ""
    echo "     systemctl --user enable --now ydotool"
    echo ""
    echo "     Note: the service name is 'ydotool', NOT 'ydotoold'."
    echo ""
    echo "  2. Log out and back in for group changes to take effect."
    echo ""
    echo "  3. Start LinuxWhisper:"
    echo ""
    echo "     # One-time start:"
    echo "     linuxwhisper start"
    echo ""
    echo "     # Or enable as a systemd service (auto-start on login):"
    echo "     systemctl --user enable --now linuxwhisper"
    echo ""
    echo "  Troubleshooting:"
    echo ""
    echo "     journalctl --user -u linuxwhisper -f"
    echo ""
    echo "============================================================"
    echo ""
}

post_upgrade() {
    post_install
}