Created
November 3, 2016 07:57
-
-
Save merrickluo/a51cb18d756d8609694a57cb6f17b6b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# making fcitx working in emacs | |
client="emacsclient" | |
# I dont want to start a new frame if there is one | |
frame_count=`emacsclient -e '(true-frame-count)' 2>/dev/null || echo -1` | |
# start server if not started | |
if [ $frame_count -lt 0 ]; then | |
LC_CTYPE=zh_CN.UTF-8 emacs --daemon | |
client="$client -c" | |
# make frame if no param coming | |
elif [ $frame_count -lt 1 ]; then | |
client="$client -c" | |
fi | |
$client $@ 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment