Skip to content

Instantly share code, notes, and snippets.

@aamedina
Created May 7, 2017 15:15
Show Gist options
  • Select an option

  • Save aamedina/a8651339efa65a40212a2ae7dfdf41db to your computer and use it in GitHub Desktop.

Select an option

Save aamedina/a8651339efa65a40212a2ae7dfdf41db to your computer and use it in GitHub Desktop.
#!/bin/bash -e
frame=`emacsclient -a "" -e "(member \"$DISPLAY\" (mapcar 'terminal-name (frames-on-display-list)))"`
if [ "$frame" == "nil" ]
then
exec emacsclient -c -n -a "" "$@"
fi
if [ "$frame" == "(\"$DISPLAY\")" ]
then
exec emacsclient -n -a "" "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment