Skip to content

Add new config tool when running ukui desktop environment #1299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions data/fcitx5-configtool.sh
Original file line number Diff line number Diff line change
@@ -65,6 +65,10 @@ detectDE() {
XFCE)
DE=xfce
break
;;
UKUI)
DE=ukui
break
esac
done
fi
@@ -131,10 +135,13 @@ run_qt() {
run_xdg() {
case "$DE" in
kde)
message "$(_ "You're currently running KDE, but KCModule for fcitx couldn't be found. The package name of this KCModule is usually kcm-fcitx5, kde-config-fcitx5, or fcitx5-configtool. Now it will open the configuration directory.")"
message "$(_ "You're currently running KDE, but the configuration tool for fcitx5 couldn't be found. The package name of the configuration tool is usually kcm-fcitx5, kde-config-fcitx5, or fcitx5-configtool. Now it will open the configuration directory.")"
;;
ukui)
message "$(_ "You're currently running UKUI desktop environment, but the configuration tool for fcitx5 couldn't be found. The package name of the configuration tool is usually ukui-control-center, or fcitx5-configtool. Now it will open the configuration directory.")"
;;
*)
message "$(_ "You're currently running Fcitx with GUI, but fcitx5-config-qt couldn't be found. The package name provides this binary is usually fcitx5-configtool. Now it will open the configuration directory.")"
message "$(_ "You're currently running Fcitx5 with GUI, but fcitx5-config-qt couldn't be found. The package name of the configuration tool is usually fcitx5-configtool. Now it will open the configuration directory.")"
;;
esac

@@ -148,6 +155,33 @@ run_xdg() {
fi
}

run_ukui() {
version=$(ukui-control-center -v 2>/dev/null)
# Qt version will print "appname version", so remove everything before the space.
# We don't know if "app name" will contain space (it is an i18n string), but we'd
# assume version doesn't contain space.
version=${version/* /}
# Keep only major version.
version=${version/.*/}
if [ -z "$version" ]; then
return 1
fi

# Upstream command version jumped from 2.0 to 5.0, so we are targeting a version after 2.0.
target=2

# Check if major version is a number greater than 2.
if [[ "$version" =~ ^[0-9]+$ ]]; then
if [ "$version" -gt "$target" ]; then
exec ukui-control-center -m keyboard inputmethod
fi
fi

return 1


}

_which_cmdline() {
cmd="$(command -v "$1")" || return 1
shift
@@ -164,6 +198,9 @@ case "$DE" in
kde)
order="kde qt xdg"
;;
ukui)
order="ukui qt xdg"
;;
*)
order="qt kde xdg"
;;
Loading