emacs.sh 303 B

123456789
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. # Create new frame (if there isnt one or no file is specified)
  4. if [[ -z $(pgrep -f emacsclient.\*-c) ]] || [[ $1 = "" ]]; then
  5. setsid -f emacsclient -a '' -c "$@" > /dev/null 2>&1
  6. else
  7. setsid -f emacsclient -a '' "$@" > /dev/null 2>&1
  8. fi