uninstall script supports curl pipe, update README with GitHub/Forgejo commands
Some checks are pending
Build & Release / Build & test (push) Waiting to run
Build & Release / Build .deb (push) Blocked by required conditions

This commit is contained in:
Khoa Vo 2026-07-01 16:38:46 +07:00
parent 83c3e3d1fa
commit d6e1f4d89c
2 changed files with 45 additions and 17 deletions

View file

@ -113,24 +113,38 @@ Both **VNI** and **Telex** are fully supported. Switch via **Ctrl+LeftShift** or
## Installation
### One-Command Install (recommended)
### One-Command Install
Works on both **Linux Mint** and **Ubuntu** (including 24.04+ Wayland):
**From GitHub (recommended):**
```bash
git clone https://github.com/vndangkhoa/vietc.git /tmp/vietc \
&& cd /tmp/vietc && sudo ./install.sh
```
The script will:
1. Install build + runtime dependencies
2. Compile all binaries
3. Install to `/usr/bin/`
4. Set up uinput udev rules
5. Add your user to the `input` group
**From Forgejo (self-hosted):**
```bash
git clone https://git.khoavo.myds.me/vndangkhoa/vietc.git /tmp/vietc \
&& cd /tmp/vietc && sudo ./install.sh
```
The script installs dependencies, compiles, installs to `/usr/bin/`, sets up uinput udev rules, and adds your user to the `input` group.
**After install:** Log out and log back in, then launch `vietc-tray` from your application menu.
### One-Command Uninstall
**From GitHub:**
```bash
curl -sSL https://raw.githubusercontent.com/vndangkhoa/vietc/main/uninstall.sh | sudo bash
```
**From Forgejo:**
```bash
curl -sSL https://git.khoavo.myds.me/vndangkhoa/vietc/raw/branch/main/uninstall.sh | sudo bash
```
### Manual Build & Run
```bash
@ -153,12 +167,6 @@ cargo build --release
sudo ./target/release/vietc
```
### Uninstall
```bash
sudo ./uninstall.sh
```
---
## Configuration

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Viet+ — Vietnamese Input Method Uninstaller
# Usage: curl -sSL <url> | sudo bash
set -euo pipefail
RED='\033[0;31m'; GREEN='\033[0;32m'; NC='\033[0m'
@ -9,16 +10,35 @@ RED='\033[0;31m'; GREEN='\033[0;32m'; NC='\033[0m'
echo -e "${RED}=== Viet+ Uninstaller ===${NC}"
# Kill running processes
pkill -x vietc-tray 2>/dev/null || true
pkill -x vietc-daemon 2>/dev/null || true
pkill -x vietc-uinputd 2>/dev/null || true
pkill -x vietc 2>/dev/null || true
# Remove binaries
rm -f /usr/bin/vietc-daemon /usr/bin/vietc-cli /usr/bin/vietc-uinputd \
/usr/bin/vietc-tray /usr/bin/vietc-xrecord
rm -f /usr/local/bin/vietc /usr/local/bin/vietc-daemon /usr/local/bin/vietc-cli \
/usr/local/bin/vietc-uinputd /usr/local/bin/vietc-tray /usr/local/bin/vietc-xrecord
rm -f /etc/udev/rules.d/99-vietc.rules
rm -f /etc/vietc/config.toml
rmdir /etc/vietc 2>/dev/null || true
echo -e "${GREEN}=== Done! ===${NC}"
# Remove udev rules
rm -f /etc/udev/rules.d/99-vietc.rules
# Remove config
rm -rf /etc/vietc
# Remove systemd service
rm -f /usr/lib/systemd/user/vietc.service
# Remove icons
rm -f /usr/share/icons/hicolor/256x256/apps/vietc*.svg
# Remove desktop file
rm -f /usr/share/applications/vietc.desktop
rm -f /etc/xdg/autostart/vietc-tray.desktop
# Reload
udevadm control --reload-rules 2>/dev/null || true
echo -e "${GREEN}=== Viet+ removed ===${NC}"