From 77ca030baee3450290d2b15f5ee7f86fc38fcbb7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 27 May 2022 14:26:56 +0800 Subject: [PATCH] system/i18n: switch to Flatpak-based setup --- .../i18n/files/org.fcitx.Fcitx5.desktop | 9 ++++ roles/system/i18n/meta/main.yml | 3 ++ roles/system/i18n/tasks/main.yml | 42 +++++++++++-------- 3 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 roles/system/i18n/files/org.fcitx.Fcitx5.desktop create mode 100644 roles/system/i18n/meta/main.yml diff --git a/roles/system/i18n/files/org.fcitx.Fcitx5.desktop b/roles/system/i18n/files/org.fcitx.Fcitx5.desktop new file mode 100644 index 0000000..fdb1661 --- /dev/null +++ b/roles/system/i18n/files/org.fcitx.Fcitx5.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Enable i18n with fcitx5 +TryExec=flatpak +Exec=flatpak run org.fcitx.Fcitx5 +StartupNotify=false + +X-GNOME-Autostart-Phase=Initialization +X-KDE-autostart-phase=1 diff --git a/roles/system/i18n/meta/main.yml b/roles/system/i18n/meta/main.yml new file mode 100644 index 0000000..b658239 --- /dev/null +++ b/roles/system/i18n/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - system/flatpak diff --git a/roles/system/i18n/tasks/main.yml b/roles/system/i18n/tasks/main.yml index 13bbb2a..8867995 100644 --- a/roles/system/i18n/tasks/main.yml +++ b/roles/system/i18n/tasks/main.yml @@ -1,22 +1,28 @@ +# Interestingly, it is apparently available as a Flatpak. Surprisingly, it +# works as if you installed the native package on most repos. --- +- name: Install fcitx5 nightly Flatpak repo + flatpak_remote: + state: present + name: fcitx5-unstable + flatpakrepo_url: https://flatpak.fcitx-im.org/unstable-repo/fcitx5-unstable.flatpakrepo + - name: Install i18n tools - dnf: + flatpak: state: present - name: - - fcitx5 - - fcitx5-configtool - - fcitx5-gtk4 - - fcitx5-lua - - fcitx5-mozc - - fcitx5-rime - - librime - - librime-tools - - mozc - -- name: Install fonts for i18n - dnf: - state: present - name: - - google-noto-cjk-fonts - - google-noto-cjk-fonts-common + name: "{{ item }}" + remote: fcitx5-unstable + loop: + - org.fcitx.Fcitx5 + - org.fcitx.Fcitx5.Addon.Zhuyin + - org.fcitx.Fcitx5.Addon.Unikey + - org.fcitx.Fcitx5.Addon.Rime + - org.fcitx.Fcitx5.Addon.Mozc + - org.fcitx.Fcitx5.Addon.ChineseAddons + - org.fcitx.Fcitx5.Addon.Lua +- name: Enable fcitx5 to autostart + copy: + src: "{{ role_path }}/files/org.fcitx.Fcitx5.desktop" + dest: "/etc/xdg/autostart/org.fcitx.Fcitx5.desktop" + setype: etc_t