mirror of
https://github.com/get-aurora-dev/common.git
synced 2026-11-03 21:49:43 -09:00
feat: migrate fcitx5 to flatpak and preinstall it in the future (#295)
Themes migration used from [1]. Part of [2]. [1] https://github.com/ublue-os/bazzite/pull/6122 [2] https://github.com/ublue-os/aurora/issues/3038 no preinstall files probably the better way to handle this with a notification instead of preinstalling everything, also makes it easier because we would need to wait for preinstall to have finished, which we can't easily do from the systemd user service
This commit is contained in:
parent
b8f5639b18
commit
2cd738b481
6 changed files with 72 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
|||
L /var/lib/flatpak/overrides/org.kde.krita - - - - /usr/share/factory/var/lib/flatpak/overrides/org.kde.krita
|
||||
|
|
@ -0,0 +1 @@
|
|||
L /var/lib/flatpak/overrides/com.valvesoftware.Steam - - - - /usr/share/factory/var/lib/flatpak/overrides/com.valvesoftware.Steam
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# https://linux.kde.org/docs/cjkv-input/#fixing-compatibility-issues
|
||||
# https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma
|
||||
# https://github.com/ublue-os/aurora/issues/3038
|
||||
[Environment]
|
||||
GTK_IM_MODULE=xim
|
||||
QT_IM_MODULE=xim
|
||||
QT_IM_MODULES=wayland;fcitx;ibus
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# https://linux.kde.org/docs/cjkv-input/#fixing-compatibility-issues
|
||||
# https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma
|
||||
# https://github.com/ublue-os/aurora/issues/3038
|
||||
[Environment]
|
||||
GTK_IM_MODULE=xim
|
||||
QT_IM_MODULE=xim
|
||||
QT_IM_MODULES=wayland;fcitx;ibus
|
||||
|
|
@ -5,6 +5,12 @@ flatpak "io.github.flattool.Warehouse"
|
|||
flatpak "io.github.kolunmi.Bazaar"
|
||||
flatpak "io.missioncenter.MissionCenter"
|
||||
flatpak "org.deskflow.deskflow"
|
||||
flatpak "org.fcitx.Fcitx5"
|
||||
flatpak "org.fcitx.Fcitx5.Addon.Chewing"
|
||||
flatpak "org.fcitx.Fcitx5.Addon.ChineseAddons"
|
||||
flatpak "org.fcitx.Fcitx5.Addon.Hangul"
|
||||
flatpak "org.fcitx.Fcitx5.Addon.Mozc"
|
||||
flatpak "org.fcitx.Fcitx5.Addon.Unikey"
|
||||
flatpak "org.fedoraproject.MediaWriter"
|
||||
flatpak "org.fkoehler.KTailctl"
|
||||
flatpak "org.gnome.DejaDup"
|
||||
|
|
|
|||
51
system_files/shared/usr/share/ublue-os/user-setup.hooks.d/40-flatpak.sh
Normal file → Executable file
51
system_files/shared/usr/share/ublue-os/user-setup.hooks.d/40-flatpak.sh
Normal file → Executable file
|
|
@ -3,7 +3,56 @@
|
|||
set -euo pipefail
|
||||
|
||||
source /usr/lib/ublue/setup-services/libsetup.sh
|
||||
version-script aurora-flatpak user 1 || exit 0
|
||||
version-script aurora-flatpak user 2 || exit 0
|
||||
|
||||
# https://github.com/ublue-os/aurora/issues/3038
|
||||
migrate_fcitx() {
|
||||
LOCAL_UBLUE_DIR="${XDG_DATA_HOME:-${HOME}/.local/share}/ublue"
|
||||
ID="org.fcitx.Fcitx5"
|
||||
FCITX_CONFIG_DIR="${HOME}/.config/fcitx5"
|
||||
FCITX_DATA_DIR="${HOME}/.local/share/fcitx5"
|
||||
|
||||
FCITX_FLATPAK="${HOME}/.var/app/${ID}"
|
||||
FCITX_DATA_DIR_FLATPAK="${FCITX_FLATPAK}/data"
|
||||
FCITX_CONFIG_DIR_FLATPAK="${FCITX_FLATPAK}/config"
|
||||
STAMP="aurora-fcitx-flatpak-migration"
|
||||
|
||||
# this should only show it to the people who actually used fcitx
|
||||
if [[ ! -f "${LOCAL_UBLUE_DIR}/${STAMP}" ]] && [[ -d "${FCITX_CONFIG_DIR}" ]]; then
|
||||
|
||||
if [[ -d "${FCITX_CONFIG_DIR}" ]]; then
|
||||
mkdir -p "${FCITX_CONFIG_DIR_FLATPAK}"
|
||||
cp -r "${FCITX_CONFIG_DIR}" "${FCITX_CONFIG_DIR_FLATPAK}"
|
||||
fi
|
||||
|
||||
if [[ -d "${FCITX_DATA_DIR}" ]] && [[ -n "$(ls -A "${FCITX_DATA_DIR}" 2>/dev/null)" ]]; then
|
||||
mkdir -p "${FCITX_DATA_DIR_FLATPAK}"
|
||||
cp -r "${FCITX_DATA_DIR}" "${FCITX_DATA_DIR_FLATPAK}"
|
||||
fi
|
||||
|
||||
TITLE="Fcitx has been removed from the system"
|
||||
MESSAGE="Please reinstall Fcitx from Bazaar so you can install all the necessary add-ons for your languages and make sure it is enabled in the Virtual Keyboard Settings."
|
||||
|
||||
ACTION=$(notify-send \
|
||||
--app-name=Aurora \
|
||||
--icon=input-keyboard-virtual \
|
||||
--urgency=critical \
|
||||
"${TITLE}" \
|
||||
"${MESSAGE}" \
|
||||
--action="open=Install Fcitx" \
|
||||
--action="info=More Info/Help"
|
||||
)
|
||||
|
||||
if [[ "$ACTION" = "open" ]]; then
|
||||
xdg-open appstream://${ID}
|
||||
elif [[ "$ACTION" = "info" ]]; then
|
||||
xdg-open "https://github.com/ublue-os/aurora/issues/3038"
|
||||
fi
|
||||
touch "${LOCAL_UBLUE_DIR}/${STAMP}"
|
||||
fi
|
||||
}
|
||||
|
||||
migrate_fcitx
|
||||
|
||||
# More consistent Qt/GTK themes for Flatpaks
|
||||
flatpak override --user --filesystem=xdg-config/gtk-4.0:ro
|
||||
|
|
|
|||
Loading…
Reference in a new issue