diff options
author | Bian Jiaping | 2018-01-05 22:48:05 +0800 |
---|---|---|
committer | Bian Jiaping | 2018-01-05 22:48:05 +0800 |
commit | 7aefd0d05144177ef0f2a2b496fc68afba8b5a19 (patch) | |
tree | 00e691dc938d877650caa9cd44b845eb42c098a2 | |
parent | 85f71010a2a5e78265dfd760a8ccd7d836f426b5 (diff) | |
download | aur-7aefd0d05144177ef0f2a2b496fc68afba8b5a19.tar.gz |
Refactor PKGBUILD and autostart script
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | README.md | 37 | ||||
-rwxr-xr-x | sogou-autostart | 13 |
5 files changed, 56 insertions, 58 deletions
@@ -1,24 +1,23 @@ -# Generated by mksrcinfo v8 -# Thu Nov 2 14:01:40 UTC 2017 pkgbase = fcitx-sogoupinyin pkgdesc = Sogou Pinyin for Linux pkgver = 2.2.0.0102 - pkgrel = 1 - url = http://pinyin.sogou.com/linux/ + pkgrel = 2 + url = https://pinyin.sogou.com/linux/ arch = x86_64 arch = i686 license = custom depends = fcitx depends = opencc depends = libidn - depends = fcitx-qt4 depends = lsb-release depends = xorg-xprop depends = qtwebkit - source = http://cdn2.ime.sogou.com/dl/index/1509619794/sogoupinyin_2.2.0.0102_amd64.deb source = sogou-autostart - md5sums = 2a58e8b4c2ae619e2b3f706665a559d5 - md5sums = 60b1dcd637c932cf4f3bfaed797f5401 + md5sums = d20f07816f7be4bcd11e7a6f527de425 + source_x86_64 = http://cdn2.ime.sogou.com/dl/index/1509619794/sogoupinyin_2.2.0.0102_amd64.deb + md5sums_x86_64 = 2a58e8b4c2ae619e2b3f706665a559d5 + source_i686 = http://cdn2.ime.sogou.com/dl/index/1509619879/sogoupinyin_2.2.0.0102_i386.deb + md5sums_i686 = 6845cbfe09d0e1b5a6c62c3c092a9c09 pkgname = fcitx-sogoupinyin diff --git a/.gitignore b/.gitignore index f7d6f3c1adea..e3ca01479e3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /pkg /src /*.tar.xz +/*.tar /*.deb @@ -5,52 +5,40 @@ pkgname=fcitx-sogoupinyin pkgver=2.2.0.0102 -pkgrel=1 +pkgrel=2 pkgdesc="Sogou Pinyin for Linux" arch=('x86_64' 'i686') -url="http://pinyin.sogou.com/linux/" +url="https://pinyin.sogou.com/linux/" license=('custom') -depends=('fcitx' 'opencc' 'libidn' 'fcitx-qt4' 'lsb-release' 'xorg-xprop' 'qtwebkit') - -if [ "${CARCH}" = "i686" ]; then - _LIB_DIR=i386-linux-gnu - _ARCH=i386 - _time=1509619879 - _md5_checksum=6845cbfe09d0e1b5a6c62c3c092a9c09 -else - _LIB_DIR=x86_64-linux-gnu - _ARCH=amd64 - _time=1509619794 - _md5_checksum=2a58e8b4c2ae619e2b3f706665a559d5 -fi - -source=( - "http://cdn2.ime.sogou.com/dl/index/${_time}/sogoupinyin_${pkgver}_${_ARCH}.deb" - "sogou-autostart" -) -md5sums=( - ${_md5_checksum} - 60b1dcd637c932cf4f3bfaed797f5401 -) +depends=('fcitx' 'opencc' 'libidn' 'lsb-release' 'xorg-xprop' 'qtwebkit') + +_i686_time=1509619879 +_x86_64_time=1509619794 +source=('sogou-autostart') +source_i686=("http://cdn2.ime.sogou.com/dl/index/${_i686_time}/sogoupinyin_${pkgver}_i386.deb") +source_x86_64=("http://cdn2.ime.sogou.com/dl/index/${_x86_64_time}/sogoupinyin_${pkgver}_amd64.deb") + +md5sums=('d20f07816f7be4bcd11e7a6f527de425') +md5sums_x86_64=('2a58e8b4c2ae619e2b3f706665a559d5') +md5sums_i686=('6845cbfe09d0e1b5a6c62c3c092a9c09') package(){ cd ${srcdir} - tar xJvf data.tar.xz -C "${pkgdir}" + tar -xJvf data.tar.xz -C "${pkgdir}" - mv "$pkgdir"/usr/lib/{$_LIB_DIR/,}fcitx - rmdir "$pkgdir/usr/lib/${_LIB_DIR}" + mv "$pkgdir"/usr/lib/*-linux-gnu/fcitx "$pkgdir"/usr/lib/ + rmdir "$pkgdir"/usr/lib/*-linux-gnu - # Avoid "No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings'" warning + # Avoid warning "No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings'" sed -i "s#Gtk/IMModule=fcitx#overrides={'Gtk/IMModule':<'fcitx'>}#" "$pkgdir"/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override rm -r "$pkgdir"/usr/share/keyrings + rm -r "$pkgdir"/etc/X11 ln -s /usr/lib/libopencc.so "$pkgdir"/usr/lib/libopencc.so.1 install -m755 sogou-autostart "$pkgdir"/usr/bin - rm "$pkgdir"/etc/xdg/autostart/fcitx-ui-sogou-qimpanel.desktop - cp "$pkgdir"/usr/share/applications/fcitx-ui-sogou-qimpanel.desktop "$pkgdir"/etc/xdg/autostart/fcitx-ui-sogou-qimpanel.desktop sed -i 's/sogou-qimpanel\ %U/sogou-autostart/g' "$pkgdir"/etc/xdg/autostart/fcitx-ui-sogou-qimpanel.desktop } diff --git a/README.md b/README.md index 77807cad72ea..599290185515 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,39 @@ -# Fcitx sogoupinyin +# fcitx-sogoupinyin -[Sogoupinyin](http://pinyin.sogou.com/linux/) for Arch Linux. +AUR package of [sogoupinyin for Linux](http://pinyin.sogou.com/linux/). ## Installation -``` -yaourt -S fcitx-sogoupinyin +This package is available on both [AUR](https://aur.archlinux.org/packages/fcitx-sogoupinyin/) and [archlinuxcn repository](https://www.archlinuxcn.org/archlinux-cn-repo-and-mirror/). + +```bash +# Use pacaur or any other AUR helpers to install from AUR +pacaur -S fcitx-sogoupinyin ``` -Don't forget to add this input method in Fcitx configurations. +Don't forget to add this input method in Fcitx configuration. ## Configuration -It should work out of the box. +No configuration is needed. -In case it doesn't work in Gnome 3, add the following to `~/.xprofile`: +For fcitx's configuation, refer to [Fcitx#Configuration](https://wiki.archlinux.org/index.php/Fcitx#Configuration) on ArchWiki. -``` -export GTK_IM_MODULE=fcitx -export QT_IM_MODULE=fcitx -export XMODIFIERS="@im=fcitx" +## Troubleshooting -gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}" -``` +### Unable to start -## Troubleshooting +__Make sure fcitx is running before start `sogou-qimpanel`.__ + +Try one of the following methods: + +* Delete sogou lock files: `rm -rf ~/.sogouinput/` +* Relogin the desktop environment +* Delete all sogou related files: `rm -rf ~/.sogouinput/ ~/.config/SogouPY*` -### Not work +### Not working -Try executing `rm -rf ~/.config/SogouPY*` and restart. +It's probably caused by fcitx not working. See [Fcitx#Troubleshooting](https://wiki.archlinux.org/index.php/Fcitx#Troubleshooting) on ArchWiki. ## Known issues diff --git a/sogou-autostart b/sogou-autostart index de28e1dd6b5a..ddb18e9bc5c1 100755 --- a/sogou-autostart +++ b/sogou-autostart @@ -1,6 +1,11 @@ #!/bin/sh -# sleep for a little while to avoid duplicate startup -sleep 10 - -sogou-qimpanel +# Wait for fcitx to startup +for i in $(seq 30); do + if fcitx-remote &> /dev/null; then + sogou-qimpanel + break + else + sleep 1 + fi +done |