Skip to content

Commit

Permalink
fix(backend/steps): download/install IMFs correctly, also skip if no IMs
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Jan 17, 2025
1 parent 5514266 commit a098133
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/backend/steps/_05_dnfdownloadapps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ impl super::Step for DnfDownloadApps {
.map(ToString::to_string),
);

if !settings.ims.is_empty() {
let pkgs: &[&str] = match &*CFG.edition {
"plasma" | "kde" => &[
["fcitx5-autostart", "fcitx5-qt5", "fcitx5-qt6"],
["fcitx5-gtk", "kcm-fcitx5", "fcitx5-configtool"],
]
.concat(),
_ => &["ibus-wayland", "ibus-qt", "ibus-gtk3", "ibus-gtk4"],
};
settings.actions[1].extend(pkgs.iter().map(|&s| s.to_owned()));
}
settings.actions[1].extend(
(settings.ims.iter())
.filter_map(|im| {
Expand Down
3 changes: 3 additions & 0 deletions src/backend/steps/_08_setup_imf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ impl super::Step for SetupImf {
settings: &crate::backend::settings::Settings,
sender: relm4::Sender<crate::pages::InstallingPageMsg>,
) -> color_eyre::Result<()> {
if settings.ims.is_empty() {
return Ok(());
}
match &*CFG.edition {
"plasma" | "kde" => write_fcitx5_profile(settings).await,
_ => write_ibus_profile(settings).await,
Expand Down

0 comments on commit a098133

Please sign in to comment.