Skip to content

Instantly share code, notes, and snippets.

@ofan
Created December 13, 2010 08:23
Show Gist options
  • Save ofan/738787 to your computer and use it in GitHub Desktop.
Save ofan/738787 to your computer and use it in GitHub Desktop.
#!/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