/usr/bin/fcitx-skin-installer is in fcitx-bin 1:4.2.9.6-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 | #!/bin/sh
export TEXTDOMAIN=fcitx
if which kdialog > /dev/null 2>&1; then
message() {
kdialog --msgbox "$1"
}
error() {
kdialog --error "$1"
}
elif which zenity > /dev/null 2>&1; then
message() {
zenity --info --text="$1"
}
error() {
zenity --error --text="$1"
}
else
message() {
echo "$1"
}
error() {
echo "$1" >&2
}
fi
if which gettext > /dev/null 2>&1; then
_() {
gettext "$@"
}
else
_() {
echo "$@"
}
fi
usage() {
error "Usage: $0 [skin file]"
exit 1
}
if [ $# != 1 ]; then
usage
fi
_filelist=$(tar -tf "$1")
if [ "$(echo "${_filelist}" | grep -c '^[^/]*/$' 2> /dev/null)" != "1" ]; then
error "$(_ "Error: skin file should only contain one directory.")"
exit 1
fi
if ! echo "${_filelist}" | grep "^[^/]*/fcitx_skin.conf" > /dev/null 2>&1; then
error "$(_ "Error: skin file doesn't contain skin config.")"
exit 1
fi
if [ -n "$XDG_CONFIG_HOME" ]; then
SKINPATH="$XDG_CONFIG_HOME/fcitx/skin"
elif [ -n "$HOME" ]; then
SKINPATH="$HOME/.config/fcitx/skin"
else
error "$(_ '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
}
if tar -C "$SKINPATH" -xf "$1"; then
message "$(_ "Successfully Installed skin")"
else
error "$(_ "Error: skin failed to install")"
exit 1
fi
|