/usr/bin/fcitx-skin-installer 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 82 | #!/bin/sh
export TEXTDOMAIN=fcitx
if which kdialog > /dev/null 2>&1; then
MESSAGE_ERROR="kdialog --error"
MESSAGE_COMMON="kdialog --msgbox"
elif which zenity > /dev/null 2>&1; then
MESSAGE_ERROR="zenity_error"
MESSAGE_COMMON="zenity_info"
else
MESSAGE_ERROR="echo"
MESSAGE_COMMON="echo"
fi
zenity_error()
{
zenity --error --text="$1"
}
zenity_info()
{
zenity --info --text="$1"
}
usage()
{
echo "Usage: fcitx-skin-installer [skin file]"
exit 1
}
message()
{
$MESSAGE_COMMON "$1"
}
error()
{
$MESSAGE_ERROR "$1"
}
if [ $# != 1 ]; then
usage
fi
DIRCOUNT=`tar -tf $1 | grep -c '/$'`
if [ "x$DIRCOUNT" != "x1" ]; then
error `gettext "Error: skin file should only contain one directory."`
exit 1
fi
DIRNAME=`tar -tf $1 | grep '/$'`
tar -tf $1 ${DIRNAME}fcitx_skin.conf >/dev/null 2>&1
if [ $? != 0 ]; then
error `gettext "Error: skin file doesn't contain skin config."`
exit 1
fi
SKINPATH=
if [ ! -z "$XDG_CONFIG_HOME" ]; then
SKINPATH=$XDG_CONFIG_HOME/fcitx/skin
elif [ ! -z "$HOME" ]; then
SKINPATH=$HOME/.config/fcitx/skin
fi
if [ -z "$SKINPATH" ]; then
error `gettext 'Error: $HOME or $XDG_CONFIG_HOME is not set, cannot determine the install path'`
exit 1
fi
mkdir -p $SKINPATH || ( echo "Error: cannot create skin dir" ; exit 1 )
tar -C $SKINPATH -zxf $1
if [ $? != 0 ]; then
error `gettext "Error: skin failed to install"`
exit 1
else
message `gettext "Successfully Installed skin"`
fi
|