Skip to content

Instantly share code, notes, and snippets.

@merrickluo
Created November 3, 2016 07:57
Show Gist options
  • Save merrickluo/a51cb18d756d8609694a57cb6f17b6b2 to your computer and use it in GitHub Desktop.
Save merrickluo/a51cb18d756d8609694a57cb6f17b6b2 to your computer and use it in GitHub Desktop.
#!/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