/usr/bin/fcitx-configtool is in fcitx-bin 1:4.2.0-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/bin/sh
#--------------------------------------
# fcitx-config
#
# from xdg-open
detectDE()
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
fi
}
run_kde()
{
command=`which kcmshell4 2>&1`
haskde=0
if [ $? -eq 0 ]; then
checkinstalled=`$command --list | grep -c kcm_fcitx`
if [ "x$checkinstalled" != "x0" ]; then
haskde=1
fi
fi
if [ $haskde = "1" ]; then
exec $command kcm_fcitx
else
run_gtk
fi
}
run_gtk()
{
command=`which fcitx-config-gtk 2>&1`
if [ $? -eq 0 ]; then
exec $command
else
run_gtk3
fi
}
run_gtk3()
{
command=`which fcitx-config-gtk3 2>&1`
if [ $? -eq 0 ]; then
exec $command
else
run_xdg
fi
}
run_xdg()
{
command=`which xdg-open`
if [ $? -eq 0 ]; then
exec $command $HOME/.config/fcitx/config
else
exit 0
fi
}
if [ ! -n "$DISPLAY" ]; then
[ -n "$EDITOR" ] && which $EDITOR > /dev/null 2>&1 && exec $EDITOR $HOME/.config/fcitx/config
[ -n "$VISUAL" ] && which $VISUAL > /dev/null 2>&1 && exec $VISUAL $HOME/.config/fcitx/config
echo 'Please run it under X, or set $EDITOR or $VISUAL'
exit 0
fi
detectDE
case "$DE" in
kde)
run_kde
;;
*)
run_gtk
;;
esac
|