Skip to content

Commit

Permalink
improve arch base linux experience
Browse files Browse the repository at this point in the history
  • Loading branch information
czyt committed Nov 9, 2024
1 parent f0434d2 commit ef92610
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
33 changes: 29 additions & 4 deletions src/deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,43 @@ bool install_rime(void) {
case PLATFORM_LINUX:
// 检测包管理器
if (file_exists("/usr/bin/apt")) {
if (execute_command("sudo apt install fcitx-rime -y") != 0) {
log_error("Failed to install fcitx-rime");
if (execute_command("sudo apt install fcitx5-rime -y") != 0) {
log_error("Failed to install fcitx5-rime");
return false;
}
} else if (file_exists("/usr/bin/dnf")) {
if (execute_command("sudo dnf install rime-fcitx -y") != 0) {
log_error("Failed to install rime-fcitx");
return false;
}
} else if (file_exists("/usr/bin/pacman")) {
// Arch Linux 支持
log_info("Detected Arch Linux");
log_info("Please install the input method framework and RIME according to your preference:");
log_info("\nFor Fcitx5 (Recommended):");
log_info(" sudo pacman -S fcitx5 fcitx5-configtool fcitx5-gtk fcitx5-qt fcitx5-rime");
log_info("\nFor Fcitx4:");
log_info(" sudo pacman -S fcitx fcitx-configtool fcitx-rime");
log_info("\nFor IBus:");
log_info(" sudo pacman -S ibus ibus-rime");
log_info("\nAfter installation:");
log_info("1. Add input method configuration to ~/.xprofile or /etc/environment:");
log_info(" For Fcitx5:");
log_info(" GTK_IM_MODULE=fcitx");
log_info(" QT_IM_MODULE=fcitx");
log_info(" XMODIFIERS=@im=fcitx");
log_info(" SDL_IM_MODULE=fcitx");
log_info("2. Restart your system or re-login");
log_info("\nFor more details, visit: https://wiki.archlinux.org/title/Fcitx5");
return true;
} else {
log_error("Unsupported Linux distribution");
return false;
log_error("Your Linux distribution is not directly supported");
log_info("Please visit https://rime.im for installation instructions");
log_info("You can also check the following resources:");
log_info("- Rime project: https://github.com/rime/home");
log_info("- Installation guide: https://github.com/rime/home/wiki/RimeWithIBus");
log_info("- User guide: https://github.com/rime/home/wiki/UserGuide");
return true;
}
break;

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void print_usage(void) {
}

void print_version(void) {
printf("rime-deploy version 1.0.1\n");
printf("rime-deploy version 1.0.2\n");
}

int main(int argc, char *argv[]) {
Expand Down

0 comments on commit ef92610

Please sign in to comment.