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 2 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
31 changes: 29 additions & 2 deletions data/fcitx5-configtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ detectDE() {
XFCE)
DE=xfce
break
;;
UKUI)
DE=ukui
break
esac
done
fi
Expand Down Expand Up @@ -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

Expand All @@ -148,6 +155,23 @@ run_xdg() {
fi
}

run_ukui() {
version=$(ukui-control-center -v 2>/dev/null | awk '{print $2}')
if [ -z "$version" ]; then
return 1
fi

version_num=$(echo "$version" | tr -d '.')

target=5000

if [ "$version_num" -lt "$target" ]; then
return 1
fi

exec ukui-control-center -m keyboard inputmethod
}

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