@@ -1012,106 +1012,6 @@ check_fcitx() {
1012
1012
fi
1013
1013
}
1014
1014
1015
- _find_config_gtk () {
1016
- [ -n " ${_config_tool_gtk_exe} " ] && {
1017
- echo " ${_config_tool_gtk_exe} "
1018
- return 0
1019
- }
1020
- local config_gtk
1021
- config_gtk=" $( command -v " fcitx5-config-gtk" 2> /dev/null) " || return 1
1022
- echo " ${config_gtk} "
1023
- _config_tool_gtk_exe=" ${config_gtk} "
1024
- }
1025
-
1026
- _check_config_gtk_version () {
1027
- local version=$1
1028
- local config_gtk
1029
- [ -z " ${_config_tool_gtk_version} " ] && {
1030
- config_gtk=" $( _find_config_gtk) " || return 1
1031
- ld_info=" $( ldd " $config_gtk " 2> /dev/null) " ||
1032
- ld_info=" $( objdump -p " $config_gtk " 2> /dev/null) " || return 1
1033
- if [[ $ld_info =~ libgtk[-._a-zA-Z0-9]* 3[-._a-zA-Z0-9]* \. so ]]; then
1034
- _config_tool_gtk_version=3
1035
- elif [[ $ld_info =~ libgtk[-._a-zA-Z0-9]* 2[-._a-zA-Z0-9]* \. so ]]; then
1036
- _config_tool_gtk_version=2
1037
- else
1038
- return 1
1039
- fi
1040
- }
1041
- [ " ${_config_tool_gtk_version} " = " $version " ]
1042
- }
1043
-
1044
- _check_config_gtk () {
1045
- local version=$1
1046
- local config_gtk config_gtk_name
1047
- write_order_list_eval " $( _ ' Config GUI for gtk${1}:' ) " " ${version} "
1048
- if ! config_gtk=" $( command -v " fcitx5-config-gtk${version} " 2> /dev/null) " ; then
1049
- if ! _check_config_gtk_version " ${version} " ; then
1050
- write_error_eval \
1051
- " $( _ ' Config GUI for gtk${1} not found.' ) " " ${version} "
1052
- return 1
1053
- else
1054
- config_gtk=$( _find_config_gtk)
1055
- config_gtk_name=" fcitx5-config-gtk"
1056
- fi
1057
- else
1058
- config_gtk_name=" fcitx5-config-gtk${version} "
1059
- fi
1060
- write_eval " $( _ ' Found ${1} at ${2}.' ) " \
1061
- " $( code_inline " ${config_gtk_name} " ) " \
1062
- " $( code_inline " ${config_gtk} " ) "
1063
- }
1064
-
1065
- _check_config_qt () {
1066
- local config_qt config_qt_name
1067
- config_qt_name=" fcitx5-config-qt"
1068
- write_order_list_eval " $( _ ' Config GUI for qt:' ) " " ${version} "
1069
- if ! config_qt=" $( command -v " ${config_qt_name} " 2> /dev/null) " ; then
1070
- write_error " $( _ ' Config GUI for qt not found.' ) "
1071
- return 1
1072
- fi
1073
- write_eval " $( _ ' Found ${1} at ${2}.' ) " \
1074
- " $( code_inline " ${config_qt_name} " ) " \
1075
- " $( code_inline " ${config_qt} " ) "
1076
- }
1077
-
1078
- _check_config_kcm () {
1079
- local version=$1
1080
- local kcm_shell config_kcm
1081
- write_order_list " $( _ ' Config GUI for kde:' ) "
1082
- if ! kcm_shell=" $( command -v " kcmshell${version} " 2> /dev/null) " ; then
1083
- write_error " $( print_not_found " kcmshell${version} " ) "
1084
- return 1
1085
- fi
1086
- config_kcm=" $( ${kcm_shell} --list 2> /dev/null | grep -i fcitx5) " && {
1087
- write_eval " $( _ ' Found ${1} kcm module.' ) " fcitx5
1088
- write_quote_str " ${config_kcm} "
1089
- return 0
1090
- }
1091
- return 1
1092
- }
1093
-
1094
- check_config_ui () {
1095
- local IFS=$' \n '
1096
- write_title 1 " $( _ ' Fcitx Configure UI:' ) "
1097
- write_order_list " $( _ ' Config Tool Wrapper:' ) "
1098
- if ! fcitx_configtool=" $( command -v fcitx5-configtool 2> /dev/null) " ; then
1099
- write_error_eval " $( _ ' Cannot find ${1} executable!' ) " fcitx5-configtool
1100
- else
1101
- write_eval " $( _ ' Found ${1} at ${2}.' ) " \
1102
- fcitx5-configtool \
1103
- " $( code_inline " ${fcitx_configtool} " ) "
1104
- fi
1105
- local config_backend_found=0
1106
- _check_config_qt && config_backend_found=1
1107
- _check_config_kcm 5 && config_backend_found=1
1108
- if (( ! config_backend_found)) && [[ -n " $DISPLAY$WAYLAND_DISPLAY " ]]; then
1109
- write_error_eval " $( _ ' Cannot find a GUI config tool, please install one of ${1}, or ${2}.' ) " \
1110
- " $( code_inline kcm-fcitx5) " " $( code_inline fcitx5-config-qt) "
1111
- fi
1112
- }
1113
-
1114
-
1115
1015
# ############################
1116
1016
# front end
1117
1017
# ############################
@@ -1779,7 +1679,6 @@ check_istty
1779
1679
check_system
1780
1680
check_env
1781
1681
check_fcitx
1782
- check_config_ui
1783
1682
1784
1683
(( _check_frontend)) && {
1785
1684
write_title 1 " $( _ ' Frontends setup:' ) "
0 commit comments