init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
27
Telegram/ThirdParty/hime/scripts/Makefile
vendored
Normal file
27
Telegram/ThirdParty/hime/scripts/Makefile
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
include ../config.mak
|
||||
|
||||
SCRIPTS=hime-user-setup utf8-edit gtab.append_prepare tsin-gtab-import
|
||||
BIN_SCRIPTS=hime-env
|
||||
|
||||
.PHONY: all
|
||||
all: $(SCRIPTS)
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install -d "$(HIME_SCRIPT_DIR)"
|
||||
install -m 755 $(SCRIPTS) "$(HIME_SCRIPT_DIR)"
|
||||
install -d "$(bindir)"
|
||||
install -m 755 $(BIN_SCRIPTS) "$(bindir)"
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
cd $(HIME_SCRIPT_DIR) && rm -f $(SCRIPTS)
|
||||
cd $(bindir) && rm -f $(BIN_SCRIPTS)
|
||||
rmdir --ignore-fail-on-non-empty $(bindir)
|
||||
rmdir --ignore-fail-on-non-empty $(HIME_SCRIPT_DIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo "clean up"
|
||||
@rm -f *~ tags core.*
|
||||
|
||||
6
Telegram/ThirdParty/hime/scripts/gtab.append_prepare
vendored
Normal file
6
Telegram/ThirdParty/hime/scripts/gtab.append_prepare
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f "$1" ] && exit 0
|
||||
|
||||
echo 'aaaa 輸入要定義的詞' >"$1"
|
||||
echo 'bbbb 或是字' >>"$1"
|
||||
122
Telegram/ThirdParty/hime/scripts/hime-env
vendored
Normal file
122
Telegram/ThirdParty/hime/scripts/hime-env
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
#!/bin/sh
|
||||
# Copyright and license see bottom of this file
|
||||
echo "====Detecting hime install===="
|
||||
HIME_BINARY=$(whereis hime | cut -d ' ' -f 2)
|
||||
if [ -x "$HIME_BINARY" ]; then
|
||||
echo "==>Hime binary found."
|
||||
else
|
||||
echo
|
||||
echo "==>Your hime is not installed properly. Bye."
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
if [ -x "$HIME_BINARY" ]; then
|
||||
echo
|
||||
echo "==>$HIME_BINARY:$("$HIME_BINARY" -v 2>&1 | grep version | sed -e 's/$/, linked to/') $(ldd "$HIME_BINARY" | awk '/gtk/{print $3}')"
|
||||
|
||||
find /usr/share/doc/ -path "*hime*" -name ChangeLog.Debian.gz \
|
||||
-exec echo -n "==>{}: " \; -exec zcat {} \; -exec head -n 1 \;
|
||||
find /usr/share/doc/ -path "*hime*" -name ChangeLog \
|
||||
-exec echo -n "==>{}: " \; -exec head -n 1 {} \;
|
||||
fi
|
||||
echo
|
||||
echo
|
||||
echo "====Detecting OS/Distribution===="
|
||||
# OS / distribution
|
||||
uname -a | sed -e "s/$(hostname)//" -e "s/$USER//" | tr -s ' ' ' '
|
||||
|
||||
echo
|
||||
lsb_release -a 2>/dev/null | grep -v "LSB Version"
|
||||
find /etc -name "*version" \
|
||||
-exec echo "{}:" \; -exec cat {} \; 2>/dev/null
|
||||
|
||||
find /etc -name "*release" \
|
||||
-exec echo "{}:" \; -exec cat {} \; 2>/dev/null
|
||||
|
||||
echo
|
||||
echo "/etc/issue: $(head -n 1 /etc/issue | sed 's/$/\\/' | cut -d "\\" -f 1)"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "====Detecting Environment Variables===="
|
||||
if [ -n "$XMODIFIERS" ] || [ -n "$LC_ALL" ] || [ -n "$LC_CTYPE" ] ||
|
||||
[ -n "$LANG" ] || [ -n "$LANGUAGE" ] || [ -n "$GTK_IM_MODULE" ] ||
|
||||
[ -n "$QT_IM_MODULE" ] ; then
|
||||
echo
|
||||
[ -n "$XMODIFIERS" ] && echo "XMODIFIERS : XMODIFIERS=$XMODIFIERS"
|
||||
[ -n "$LANG" ] && echo "LANG : LANG=$LANG"
|
||||
[ -n "$LANGUAGE" ] && echo "LANGUAGE : LANGUAGE=$LANGUAGE"
|
||||
[ -n "$LC_CTYPE" ] && echo "LC_CTYPE : LC_CTYPE=$LC_CTYPE"
|
||||
[ -n "$LC_ALL" ] && echo "LC_ALL : LC_ALL=$LC_ALL"
|
||||
locale 2>/dev/null | grep -v '"' | sed 's/=/\t : /' | grep -v ': $'
|
||||
[ -n "$GTK_IM_MODULE" ] && echo "GTK_IM_MODULE: GTK_IM_MODULE=$GTK_IM_MODULE"
|
||||
[ -n "$QT_IM_MODULE" ] && echo "QT_IM_MODULE : QT_IM_MODULE=$QT_IM_MODULE"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "====Detecting hime status===="
|
||||
echo "==>Running hime number: ""$(pgrep ^hime$ | wc -l)"
|
||||
|
||||
echo
|
||||
# TODO: get tempdir from TMPDIR, TMP, and TEMP
|
||||
echo "==>hime socket number: $(find "/tmp/.hime-$USER" -name "socket*" | wc -l)"
|
||||
|
||||
echo
|
||||
echo "==>System library path: "
|
||||
ls -d /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64 2>/dev/null
|
||||
|
||||
echo "====Immodule status===="
|
||||
# TODO: detect more binary name of gtk-query-immodules-2.0
|
||||
GTK_QUERY_2=$(whereis gtk-query-immodules-2.0 | cut -d ' ' -f 2)
|
||||
|
||||
if [ ! -x "$GTK_QUERY_IMMODULES_2" ]; then
|
||||
GTK_QUERY_IMMODULES_2="$(find /usr/lib -path "*libgtk2.0-0*" -name gtk-query-immodules-2.0)"
|
||||
fi
|
||||
|
||||
if [ -x "$GTK_QUERY_2" ]; then
|
||||
echo
|
||||
echo "==>gtk-query-immodules-2.0:"
|
||||
ls -d "$("$GTK_QUERY_2" | grep hime | cut -d '"' -f 2 | grep '/')"
|
||||
fi
|
||||
echo
|
||||
echo "==>gtk-2.0 immodule cache"
|
||||
find /etc /usr/lib64 /usr/lib /usr/local/etc \
|
||||
-path "*gtk-2.0*" -name "*immodules*" \
|
||||
-exec grep hime '{}' \; 2>/dev/null |
|
||||
cut -d '"' -f 2 | grep so
|
||||
|
||||
# TODO: detect more binary name of gtk-query-immodules-3.0
|
||||
GTK_QUERY_3=$(whereis gtk-query-immodules-3.0 | cut -d ' ' -f 2)
|
||||
|
||||
if [ ! -x "$GTK_QUERY_IMMODULES_3" ]; then
|
||||
GTK_QUERY_IMMODULES_3="$(find /usr/lib -path "*libgtk-3.0*" -name gtk-query-immodules-3.0)"
|
||||
fi
|
||||
|
||||
if [ -x "$GTK_QUERY_3" ]; then
|
||||
echo
|
||||
echo "==>gtk-query-immodules-3.0:"
|
||||
ls -d "$("$GTK_QUERY_3" | grep hime | cut -d '"' -f 2 | grep '/')"
|
||||
fi
|
||||
echo
|
||||
echo "==>gtk-3.0 immodule cache"
|
||||
find /usr/lib64 /usr/lib /usr/local/lib \
|
||||
-path "*gtk-3.0*" -name "immodules.cache*" \
|
||||
-exec grep hime '{}' \; 2>/dev/null |
|
||||
cut -d '"' -f 2 | grep so
|
||||
|
||||
# Copyright (C) 2012 Wen-Yen Chuang <caleb AT calno DOT com>
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
38
Telegram/ThirdParty/hime/scripts/hime-user-setup
vendored
Normal file
38
Telegram/ThirdParty/hime/scripts/hime-user-setup
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "please specify hime_table_dir hime_bin_dir"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pushd "$HOME"
|
||||
|
||||
if [ ! -d .config/hime/config ]; then
|
||||
mkdir -p .config/hime/config
|
||||
fi
|
||||
|
||||
cd "$1" || echo "$1 is not a hime table dir"
|
||||
|
||||
for i in pho.tab2 pho-huge.tab2 s-pho.tab2 s-pho-huge.tab2 tsin* s-tsin* symbol-table phrase.table; do
|
||||
if [ ! -f "$HOME/.config/hime/$i" ]; then
|
||||
cp "$i" ~/.config/hime
|
||||
fi
|
||||
done
|
||||
|
||||
pushd "$HOME/.config/hime"
|
||||
|
||||
diff1=''
|
||||
if ! diff tsin-1.src "$1/tsin-1.src" >/dev/null 2>&1; then
|
||||
diff1='Y'
|
||||
fi
|
||||
|
||||
if [ ! -f tsin-1.src ] || [ -n "$diff1" ]; then
|
||||
echo "merge tsin-1.src"
|
||||
cp "$1/tsin-1.src" .
|
||||
"$2/hime-tsd2a32" tsin32 >tmpfile
|
||||
cat tsin-1.src >>tmpfile
|
||||
"$2/hime-tsa2d32" tmpfile
|
||||
fi
|
||||
|
||||
popd # ~/.config/hime
|
||||
popd # ~/
|
||||
22
Telegram/ThirdParty/hime/scripts/tsin-gtab-import
vendored
Normal file
22
Telegram/ThirdParty/hime/scripts/tsin-gtab-import
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
pushd "$HOME/.config/hime"
|
||||
f="$1.append.gtab.tsin-db"
|
||||
echo "$f"
|
||||
|
||||
if [ ! -f "$f" ]; then
|
||||
f="$1.tsin-db"
|
||||
echo "$f"
|
||||
if [ ! -f "$f" ]; then
|
||||
echo "No $1.*.gtab.tsin-db exist"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
fsrc="$f.src"
|
||||
|
||||
"$HIME_BIN_DIR/hime-tsd2a32" "$f" >"$fsrc"
|
||||
cat "$2" >>"$fsrc"
|
||||
"$HIME_BIN_DIR/hime-tsa2d32" "$fsrc" "$f"
|
||||
|
||||
popd # ~/.config/hime
|
||||
21
Telegram/ThirdParty/hime/scripts/utf8-edit
vendored
Normal file
21
Telegram/ThirdParty/hime/scripts/utf8-edit
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH="$PATH:/opt/gnome/bin:/usr/local/bin"
|
||||
|
||||
for i in madedit gedit leafpad l3afpad kedit kate gvim; do
|
||||
if command -v "$i" >/dev/null 2>&1; then
|
||||
UTF8ED=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
export LC_CTYPE=zh_TW.UTF-8
|
||||
export LC_ALL=zh_TW.UTF-8
|
||||
|
||||
if [ "$UTF8ED" = "gvim" ]; then
|
||||
UTF8ED='gvim -f'
|
||||
fi
|
||||
|
||||
if [ -n "$UTF8ED" ]; then
|
||||
"$UTF8ED" "$1"
|
||||
fi
|
||||
Reference in New Issue
Block a user