Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
if [ -z "`ps aux | grep 'emacs --daemon'|grep -v grep`" ];then
echo "Daemon is not started,starting daemon..."
emacs --daemon >/dev/null 2>&1
fi
list=`wmctrl -l|grep "emacs"`
if [ -z "$list" ];then
emacsclient -nc $*
else
emacsclient -n $*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment