nix-config/run-emacsclient

18 lines
444 B
Bash
Executable file

#!/usr/bin/env bash
if [ -z "$EMACSCLIENT_OPTS" ]; then
EMACSCLIENT_OPTS="-nc"
fi
if [ $# -eq 0 ]; then
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' -e "(if (display-graphic-p) (x-focus-frame nil))"'
else
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' "$@"'
fi
if [ -z "$(shopt | grep login_shell)" ]; then
echo "$COMMAND" | exec bash --login -s "$@"
else
eval "exec $COMMAND"
fi